Repository navigation
[build-system] make libuca builds portable and reproducible #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
e92e304
754dee2
890b77f
979a2b8
01fbfc0
b8cb040
f682097
2e97b63
e1c8fbd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| subdir('gui') | ||
| if not get_option('gui').disabled() | ||
| subdir('gui') | ||
| endif | ||
| subdir('tools') |
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The rational behind these changes: If we left the code unchanged, the camera could acquire correct images, but uca-grab could save them in a TIFF file that some programs read incorrectly or reject.
I asked to find failure scenarious:
So it seems the firs one is serious. And the 2 and 3rd issues which may arise in other programs or apps during reading. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| "version": "0.5", | ||
| "requires": [ | ||
| "zstd/1.5.7#b68ca8e3de04ba5957761751d1d661f4%1760955092.069", | ||
| "zlib/1.3.2#1cb806da49011867778ffb6ac7190fcb%1777558780.503", | ||
| "xz_utils/5.8.3#a8432fead347c69d8b2737c35f936132%1775752656.4", | ||
| "pcre2/10.42#a0b25dffca18f5987304619e9c93fb44%1783075188.143", | ||
| "libtiff/4.7.2#7283595b6a38d0781953fa63881e0e92%1783597163.469", | ||
| "libselinux/3.6#5a78ff6ae5034eeaac8da723361a8ce4%1717655459.344", | ||
| "libmount/2.39.2#64850679fa9d5ead878e5076b0cab2a8%1705591482.625", | ||
| "libjpeg/9f#8b1b89da851ad9172565c35f14e23c4c%1780476337.068", | ||
| "libiconv/1.17#9923bc6dc6f106646d6967e0039a5ada%1774021608.288", | ||
| "libgettext/0.22#b09eea019e19b9b9c46d8f1da7d75444%1765809130.834", | ||
| "libffi/3.4.8#a045c00fb26779635e3bed40e80c5254%1753360042.396", | ||
| "glib/2.86.5#2886b0810a99a7d54b313db5d214f221%1783335578.429", | ||
| "elfutils/0.190#8e8c47bd9b2578e29a0341b09b977be8%1739188192.515", | ||
| "bzip2/1.0.8#c470882369c2d95c5c77e970c0c7e321%1762886692.465" | ||
| ], | ||
| "build_requires": [ | ||
| "pkgconf/2.5.1#93c2051284cba1279494a43a4fcfeae2%1757684701.089", | ||
| "pkgconf/2.2.0#4ac315b50ef734072b00ff3aacbf52bf%1755505628.021", | ||
| "ninja/1.13.2#c8c5dc2a52ed6e4e42a66d75b4717ceb%1764096931.974", | ||
| "msys2/cci.latest#d22fe7b2808f5fd34d0a7923ace9c54f%1770657326.649", | ||
| "meson/1.10.2#9d2d10681fe7fe61c788c58626c89b25%1775558003.754", | ||
| "m4/1.4.19#34c4bbc3eeebe98ca6edf2f52d602e7d%1777282960.259", | ||
| "libiconv/1.17#9923bc6dc6f106646d6967e0039a5ada%1774021608.288", | ||
| "gnu-config/cci.20210814#466e9d4d7779e1c142443f7ea44b4284%1762363589.329", | ||
| "gettext/0.22.5#2f6edba611e8db1a8a18488b116e8c2a%1765299121.036", | ||
| "flex/2.6.4#efa781fc5088b47c895bd4eef6911f2e%1761560242.855", | ||
| "cmake/4.4.0#a5dd5d73bd9fc56b0fc3163a04573dc8%1784051561.926", | ||
| "bison/3.8.2#c3490cbe0078b6fd3eb4cf5ed64144dc%1755688988.644", | ||
| "automake/1.16.5#b91b7c384c3deaa9d535be02da14d04f%1755524470.56", | ||
| "autoconf/2.71#51077f068e61700d65bb05541ea1e4b0%1731054366.86" | ||
| ], | ||
| "python_requires": [], | ||
| "config_requires": [] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,29 @@ | ||
| import os | ||
|
|
||
| from conan import ConanFile | ||
| from conan.tools.cmake import cmake_layout, CMakeToolchain, CMake | ||
| from conan.tools.microsoft.visual import is_msvc | ||
| from conan.errors import ConanInvalidConfiguration | ||
|
|
||
| class UcaConan(ConanFile): | ||
| name = "libuca" | ||
| version = "2.3.0" | ||
| license = "LGPL-2.1" | ||
| version = "2.4.0" | ||
| license = "LGPL-2.1-or-later" | ||
| author = "Marius Elvert [email protected]" | ||
| url = "https://github.com/ufo-kit/libuca" | ||
| description = "GLib-based C library for unified camera access ." | ||
| topics = ("utilities",) | ||
| settings = "os", "compiler", "build_type", "arch" | ||
| options = {"shared": [True, False]} | ||
| default_options = {"shared": True} | ||
| options = { | ||
| "shared": [True, False], | ||
| "with_tiff": [True, False], | ||
| } | ||
| default_options = { | ||
| "shared": True, | ||
| "with_tiff": True, | ||
| } | ||
| generators = "CMakeDeps" | ||
| exports_sources = "src/*", "include/*", "test/*", "bin/*", "plugins/*", "CMakeLists.txt", "package.sh.in" | ||
| tool_requires = "glib/2.81.0", | ||
|
|
||
| exports_sources = "src/*", "test/*", "bin/*", "plugins/*", "cmake/*", "CMakeLists.txt", "package.sh.in", "COPYING" | ||
| def configure(self): | ||
| # These are not applicable for C libraries | ||
| self.settings.rm_safe("compiler.libcxx") | ||
|
|
@@ -26,16 +32,23 @@ def configure(self): | |
| self.options["glib"].shared = True | ||
|
|
||
| def requirements(self): | ||
| self.requires("libtiff/4.4.0") | ||
| self.requires("glib/2.81.0", transitive_headers=True) | ||
| if self.options.with_tiff: | ||
| self.requires("libtiff/4.7.2") | ||
| self.requires("glib/2.86.5", transitive_headers=True) | ||
|
|
||
| def generate(self): | ||
| tc = CMakeToolchain(self) | ||
| # glib-mkenums is a Python script from the GLib library package. | ||
| # Host dependencies are not necessarily on the build PATH (Windows). | ||
| # CMake invokes this script using the build machine's Python interpreter. | ||
| tc.variables["GLIB2_MKENUMS"] = os.path.join( | ||
| self.dependencies["glib"].package_folder, "bin", "glib-mkenums" | ||
| ).replace("\\", "/") | ||
| tc.variables["WITH_PYTHON_MULTITHREADING"] = False | ||
| tc.variables["WITH_GIR"] = False | ||
| tc.variables["WITH_GUI"] = False | ||
| tc.variables["WITH_TOOLS"] = True | ||
| tc.variables["WITH_TIFF"] = True | ||
| tc.variables["WITH_TIFF"] = bool(self.options.with_tiff) | ||
| tc.variables["USE_FIND_PACKAGE_FOR_GLIB"] = True | ||
| tc.generate() | ||
|
|
||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows building libuca and its command-line tools without TIFF support—for example, for acquisition where images are transferred or processed directly instead of saved as TIFF. This is a general build fix discovered during the work, not a PCO requirement. It can be reviewed and merged separately—or left out of the initial PCO contribution.