[-- Attachment #1.1: Type: text/plain, Size: 543 bytes --] Hi, I ended up working on a package for the image viewer Nomacs over Jul and would like some feedback on what I've managed so far. One thing that's missing is the plugins that are developed in a separate git repository [0] and not included in the source tarballs of the main repository [1]. Ideas on how to make them available in the `plugins` directory during build time are welcome. I have attached the package definition to this email. [0]: https://github.com/nomacs/nomacs-plugins/releases [1]: https://github.com/nomacs/nomacs/releases [-- Attachment #1.2: Type: text/html, Size: 780 bytes --] [-- Attachment #2: guix-package.scm --] [-- Type: text/x-scheme, Size: 2941 bytes --] (define-module (nomacs) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system cmake) #:use-module (guix licenses) #:use-module (gnu packages python) #:use-module (gnu packages qt) #:use-module (gnu packages image) #:use-module (gnu packages pkg-config) #:use-module (gnu packages image) #:use-module (gnu packages image-processing) #:use-module (gnu packages photo) #:use-module (gnu packages compression)) (define-public nomacs (package (name "nomacs") (version "3.16.224") (source (origin (method url-fetch) (uri (string-append "https://codeload.github.com/nomacs/nomacs/tar.gz/" version)) (sha256 "0z113mfxxdy3wafh0g1xxxwsc5qg0n42r4345c6rxvr6h02fkixv"))) (build-system cmake-build-system) (arguments `(#:configure-flags (list "-DENABLE_TRANSLATIONS=true" "-DUSE_SYSTEM_QUAZIP=true" (string-append "../nomacs-" ,version "/ImageLounge")) #:tests? #f)) (native-inputs `(("pkg-config" ,pkg-config))) (inputs `(("python" ,python-wrapper) ("qtbase" ,qtbase) ("qtlinguist" ,qttools) ("qtsvg" ,qtsvg) ("exiv2" ,exiv2) ("libtiff" ,libtiff) ("opencv" ,opencv) ("libraw" ,libraw) ("quazip" ,quazip))) (synopsis "Image viewer for all common formats including RAW and PSD.") (description "Nomacs is a free, open source image viewer, which supports multiple platforms. You can use it for viewing all common image formats including RAW and psd images. Nomacs features semi-transparent widgets that display additional information such as thumbnails, metadata or histogram. It is able to browse images in zip or MS Office files which can be extracted to a directory. Metadata stored with the image can be displayed and you can add notes to images. A thumbnail preview of the current folder is included as well as a file explorer panel which allows switching between folders. Within a directory you can apply a file filter, so that only images are displayed whose filenames have a certain string or match a regular expression. Activating the cache allows for instantly switching between images. Nomacs includes image manipulation methods for adjusting brightness, contrast, saturation, hue, gamma, exposure. It has a pseudo color function which allows creating false color images. A unique feature of Nomacs is the synchronization of multiple instances. With this feature you can easily compare images by zooming and/or panning at the exactly same position or even by overlaying them with different opacity. Nomacs is licensed under the GNU General Public License v3 and available for Windows, Linux, FreeBSD, Mac, and OS/2.") (home-page "https://nomacs.org/") (license gpl3))) nomacs
Hi rovanion, > (define-module (nomacs) The nomacs package should probably go to gnu/packages/image- viewers.scm. > (source (origin > (method url-fetch) > (uri (string-append " > https://codeload.github.com/nomacs/nomacs/tar.gz/" version)) > (sha256 > "0z113mfxxdy3wafh0g1xxxwsc5qg0n42r4345c6rxvr6h02fkixv"))) Use git-fetch instead and don't recurse into submodules. You will likely encounter some errors, because it doesn't seem as though nomacs expects you to have its inputs properly packages. *sigh* > `(#:configure-flags (list "-DENABLE_TRANSLATIONS=true" > "-DUSE_SYSTEM_QUAZIP=true" > (string-append "../nomacs-" ,version > "/ImageLounge")) Instead of adding the path to the source directory, try `(cd "ImageLounge")` in a phase after 'unpack. > (inputs `(("python" ,python-wrapper) > ("qtbase" ,qtbase) > ("qtlinguist" ,qttools) > ("qtsvg" ,qtsvg) > ("exiv2" ,exiv2) > ("libtiff" ,libtiff) > ("opencv" ,opencv) > ("libraw" ,libraw) > ("quazip" ,quazip))) Try to sort them alphabetically, also don't put too much effort into making the tails align. > (description "Nomacs is a free, open source image viewer, which > supports multiple platforms. You can use it for viewing all common > image formats including RAW and psd images. > > Nomacs features semi-transparent widgets that display additional > information such as thumbnails, metadata or histogram. It is able to > browse images in zip or MS Office files which can be extracted to a > directory. Metadata stored with the image can be displayed and you > can add notes to images. A thumbnail preview of the current folder is > included as well as a file explorer panel which allows switching > between folders. Within a directory you can apply a file filter, so > that only images are displayed whose filenames have a certain string > or match a regular expression. Activating the cache allows for > instantly switching between images. > > Nomacs includes image manipulation methods for adjusting brightness, > contrast, saturation, hue, gamma, exposure. It has a pseudo color > function which allows creating false color images. A unique feature > of Nomacs is the synchronization of multiple instances. With this > feature you can easily compare images by zooming and/or panning at > the exactly same position or even by overlaying them with different > opacity. > Nomacs is licensed under the GNU General Public License v3 and > available for Windows, Linux, FreeBSD, Mac, and OS/2.") fill-column is at 78. Also try to shorten this text and use double spaces (" ") between sentences. > (license gpl3) It is actually gpl3+ according to license/README.md. > One thing that's missing is the plugins that are developed in a > separate git repository [0] and not included in the source tarballs > of the main repository [1]. Ideas on how to make them available in > the `plugins` directory during build time are welcome. A trick that's often used in Guix is (inputs `(("extra-source-package" ,(origin ...))) [other inputs]) You can then (copy-recursively (assoc-ref inputs "extra-source- package") destination) in a phase between 'unpack and 'configure. Regards, Leo
[-- Attachment #1: Type: text/plain, Size: 1538 bytes --] Hi Leo and thank you for your comments. The nomacs package should probably go to gnu/packages/image- > viewers.scm. > Yup. > Use git-fetch instead and don't recurse into submodules. You will > likely encounter some errors, because it doesn't seem as though nomacs > expects you to have its inputs properly packages. *sigh* > Hmm, this one I'm not sure I understand the reasoning behind. I think I read in some packaging guidelines that url-fetch was preferred if possible. > Instead of adding the path to the source directory, try `(cd > "ImageLounge")` in a phase after 'unpack. > I'm told that cd is an unbound variable when I try that :/ #:phases (modify-phases %standard-phases (add-after 'unpack 'cd-to-source-dir (lambda _ (call-with-output-string (cd "ImageLounge"))))) Try to sort them alphabetically, also don't put too much effort into > making the tails align. > Check. > One thing that's missing is the plugins that are developed in a > > separate git repository [0] and not included in the source tarballs > > of the main repository [1]. Ideas on how to make them available in > > the `plugins` directory during build time are welcome. > A trick that's often used in Guix is > (inputs > `(("extra-source-package" > ,(origin ...))) > [other inputs]) > You can then (copy-recursively (assoc-ref inputs "extra-source- > package") destination) in a phase between 'unpack and 'configure. > Thank you! And thank you for the rest of the comments too. Happy new year! [-- Attachment #2: Type: text/html, Size: 2645 bytes --]
Hi Rovanion, Am Donnerstag, den 31.12.2020, 16:37 +0100 schrieb Rovanion Luckey: > [...] > > > Use git-fetch instead and don't recurse into submodules. You will > > likely encounter some errors, because it doesn't seem as though > > nomacs > > expects you to have its inputs properly packages. *sigh* > > Hmm, this one I'm not sure I understand the reasoning behind. I think > I read in some packaging guidelines that url-fetch was preferred if > possible. The reason is two-fold: First, it seems to me, that this is a github- generated tarball, which have been known to be unstable. Second, the tarball includes a large number of 3rd party sources already packaged in Guix. Most of them are git submodules, so by using a non-recursive checkout you can strip them without much effort. url-fetch is to be preferred, when there is a sane tarball to fetch. Most projects only hosted on github don't have that, but certain large- scale projects (such as GNU itself or GNOME) do host tarballs. It also enables mirror:// URLS, which translate to a number of hosts, the first of which to successfully provide a package is chosen. > > Instead of adding the path to the source directory, try `(cd > > "ImageLounge")` in a phase after 'unpack. > > > > I'm told that cd is an unbound variable when I try that :/ My bad, the Scheme procedure equivalent to cd is "chdir". Regards, Leo
[-- Attachment #1.1: Type: text/plain, Size: 983 bytes --] Hi Leo and thank you for explaining. And hi again guix-devel. I've now rewritten the file according to your comments except that its still its own file/module, something I'll fix later. Now I'm stuck trying to figure out a build error after going from the tarball release through url-fetch to the non-recursive git-clone download. CMake finds the package OpenCV when it runs, removing OpenCV from the package inputs results in an error from CMake (as expected). But the build fails during the build phase with the following error: > make[2]: *** No rule to make target 'opencv_core-NOTFOUND', needed by 'libnomacsCore.so.3.16.0'. Stop. I've not found any relevant mentions of opencv_core in the source code. I tried adding monkeying about with the CMakeLists a little to no avail. Also looked at what Debian does to their package but found nothing that I thought to be relevant: https://sources.debian.org/src/nomacs/3.12.0+dfsg-3/debian/ I've attached the new package source. [-- Attachment #1.2: Type: text/html, Size: 1288 bytes --] [-- Attachment #2: guix-package.scm --] [-- Type: text/x-scheme, Size: 3753 bytes --] (define-module (gnu packages nomacs) #:use-module (guix packages) #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix licenses) #:use-module (gnu packages python) #:use-module (gnu packages qt) #:use-module (gnu packages image) #:use-module (gnu packages pkg-config) #:use-module (gnu packages image) #:use-module (gnu packages image-processing) #:use-module (gnu packages photo) #:use-module (gnu packages compression)) (define-public nomacs (package (name "nomacs") (version "3.16.224") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/rovanion/nomacs") (commit version))) (sha256 "05d4hqg0gl3g9s2xf1hr7mc7g4cqarcap4nzxxa51fsphw2b8x16"))) (build-system cmake-build-system) (native-inputs `(("pkg-config" ,pkg-config))) (arguments `(#:configure-flags (list "-DENABLE_TRANSLATIONS=true" "-DUSE_SYSTEM_QUAZIP=true" "-DENABLE_OPENCV=true") #:phases (modify-phases %standard-phases (add-after 'unpack 'copy-plugins (lambda* (#:key inputs #:allow-other-keys) (copy-recursively (assoc-ref inputs "plugins") "ImageLounge/plugins"))) (add-after 'copy-plugins 'cd-to-source-dir (lambda _ (chdir "ImageLounge") #t))) #:tests? #f)) (inputs `(("plugins" ,(origin (method git-fetch) (uri (git-reference (url "https://github.com/nomacs/nomacs-plugins") (commit "3.16"))) (sha256 "1cpdwhfvaxm970nwdc1hc13848a85pqqi176m9xpa3krla9qskml"))) ("exiv2" ,exiv2) ("libraw" ,libraw) ("libtiff" ,libtiff) ("opencv" ,opencv) ("python" ,python-wrapper) ("quazip" ,quazip) ("qtbase" ,qtbase) ("qtsvg" ,qtsvg) ("qtlinguist" ,qttools))) (synopsis "Image viewer for all common formats including RAW and PSD.") (description "Nomacs is a free, open source image viewer, which supports multiple platforms. You can use it for viewing all common image formats including RAW and psd images. Nomacs features semi-transparent widgets that display additional information such as thumbnails, metadata or histogram. It is able to browse images in zip or MS Office files which can be extracted to a directory. Metadata stored with the image can be displayed and you can add notes to images. A thumbnail preview of the current folder is included as well as a file explorer panel which allows switching between folders. Within a directory you can apply a file filter, so that only images are displayed whose filenames have a certain string or match a regular expression. Activating the cache allows for instantly switching between images. Nomacs includes image manipulation methods for adjusting brightness, contrast, saturation, hue, gamma, exposure. It has a pseudo color function which allows creating false color images. A unique feature of Nomacs is the synchronization of multiple instances. With this feature you can easily compare images by zooming and/or panning at the exactly same position or even by overlaying them with different opacity. Nomacs is licensed under the GNU General Public License v3 and available for Windows, Linux, FreeBSD, Mac, and OS/2.") (home-page "https://nomacs.org/") (license gpl3+))) nomacs
[-- Attachment #1: Type: text/plain, Size: 1877 bytes --] I can get the package to build using the following steps: git clone https://github.com/nomacs/nomacs.git cd nomacs mkdir build cd build guix environment --ad-hoc cmake make gcc libraw exiv2 libtiff opencv python quazip qtbase qtsvg qttools pkg-config git cmake "../ImageLounge" "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DCMAKE_INSTALL_PREFIX=/gnu/store/fiwxb6mlwhvnr49f9ydbhbam\ wp4bzb8b-nomacs-3.16.224" "-DCMAKE_INSTALL_LIBDIR=lib" "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE" "-DCMAKE_INSTALL_RPA\ TH=/gnu/store/fiwxb6mlwhvnr49f9ydbhbamwp4bzb8b-nomacs-3.16.224/lib" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DENABLE_TRANSLATIO\ NS=true" "-DUSE_SYSTEM_QUAZIP=true" "-DENABLE_OPENCV=true" make -j 8 ./nomacs For some reason that is different than when `guix package --from-file` runs. Den fre 1 jan. 2021 kl 23:02 skrev Rovanion Luckey < rovanion.luckey@gmail.com>: > Hi Leo and thank you for explaining. And hi again guix-devel. > > I've now rewritten the file according to your comments except that its > still its own file/module, something I'll fix later. > > Now I'm stuck trying to figure out a build error after going from the > tarball release through url-fetch to the non-recursive git-clone download. > CMake finds the package OpenCV when it runs, removing OpenCV from the > package inputs results in an error from CMake (as expected). But the build > fails during the build phase with the following error: > > > make[2]: *** No rule to make target 'opencv_core-NOTFOUND', needed by > 'libnomacsCore.so.3.16.0'. Stop. > > I've not found any relevant mentions of opencv_core in the source code. I > tried adding monkeying about with the CMakeLists a little to no avail. Also > looked at what Debian does to their package but found nothing that I > thought to be relevant: > https://sources.debian.org/src/nomacs/3.12.0+dfsg-3/debian/ > > I've attached the new package source. > [-- Attachment #2: Type: text/html, Size: 2740 bytes --]
Hello Rovanion,
Am Samstag, den 02.01.2021, 15:43 +0100 schrieb Rovanion Luckey:
> I can get the package to build using the following steps:
>
> git clone https://github.com/nomacs/nomacs.git
> cd nomacs
> mkdir build
> cd build
> guix environment --ad-hoc cmake make gcc libraw exiv2 libtiff opencv
> python quazip qtbase qtsvg qttools pkg-config git
> cmake "../ImageLounge" "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-
> DCMAKE_INSTALL_PREFIX=/gnu/store/fiwxb6mlwhvnr49f9ydbhbam\
> wp4bzb8b-nomacs-3.16.224" "-DCMAKE_INSTALL_LIBDIR=lib" "-
> DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE" "-DCMAKE_INSTALL_RPA\
> TH=/gnu/store/fiwxb6mlwhvnr49f9ydbhbamwp4bzb8b-nomacs-3.16.224/lib"
> "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DENABLE_TRANSLATIO\
> NS=true" "-DUSE_SYSTEM_QUAZIP=true" "-DENABLE_OPENCV=true"
> make -j 8
> ./nomacs
>
> For some reason that is different than when `guix package --from-
> file` runs.
That doesn't say much, because `guix environment` provides little
isolation. You might try with pure environments, but the better way of
replicating the build environment is using `-K`.
I have yet to look at your package definition (pardon me), but do you
notice anything strange between the Makefiles you generate on your own
vs. the Makefiles you generate in `guix build`?
Regards,
Leo
[-- Attachment #1: Type: text/plain, Size: 1096 bytes --] Hi again Leo! That doesn't say much, because `guix environment` provides little > isolation. You might try with pure environments, but the better way of > replicating the build environment is using `-K`. > Ran in a `guix environment --pure --container` and it still built successfully. > I have yet to look at your package definition (pardon me), but do you > notice anything strange between the Makefiles you generate on your own > vs. the Makefiles you generate in `guix build`? > Thanks for the idea. Made me realise that I could run the build steps on my own in the /tmp/ folders `guix build` generates with `--keep-failed`. And in doing so I got it to build even there. Figured that it then has to be some difference in the build steps and have now figured out that it is the flag "-DCMAKE_BUILD_TYPE=RelWithDebInfo" that is causing the issue. If I changed that to `Release` instead of `RelWithDebInfo` then the package builds successfully. And it also has plugins now! I will return with a revised version later. First I will try to package libpsd, an optional dependency of Nomacs. [-- Attachment #2: Type: text/html, Size: 1588 bytes --]
Hi, On Thu, 31 Dec 2020 at 17:13, Leo Prikler <leo.prikler@student.tugraz.at> wrote: > Am Donnerstag, den 31.12.2020, 16:37 +0100 schrieb Rovanion Luckey: > > > Use git-fetch instead and don't recurse into submodules. You will > > > likely encounter some errors, because it doesn't seem as though > > > nomacs > > > expects you to have its inputs properly packages. *sigh* > > > > Hmm, this one I'm not sure I understand the reasoning behind. I think > > I read in some packaging guidelines that url-fetch was preferred if > > possible. > The reason is two-fold: First, it seems to me, that this is a github- > generated tarball, which have been known to be unstable. Second, the > tarball includes a large number of 3rd party sources already packaged > in Guix. Most of them are git submodules, so by using a non-recursive > checkout you can strip them without much effort. > > url-fetch is to be preferred, when there is a sane tarball to fetch. > Most projects only hosted on github don't have that, but certain large- > scale projects (such as GNU itself or GNOME) do host tarballs. It also > enables mirror:// URLS, which translate to a number of hosts, the first > of which to successfully provide a package is chosen. In addition, Git repos are easy to archive on Software Heritage (and fallback); "guix lint -c archival" save the source and then "guix build" fetches from SWH if the upstream has disappeared in the meantime. The story about tarballs is more complicated: the archiving is almost automatic now but the fallback does not work (yet!) even if disarchive [1] is really promising. 1: https://git.ngyro.com/disarchive/tree/README All the best, simon