EDIT: Got it! Still need to make sure there won't be unexpected bugs but it seems to be working, thus far.
ORIGINAL:
Or, in other words, I could use some help.
I'm not terribly familiar with make
and associated tools but I have this, so far:
(use-modules ((guix licenses) #:prefix license:) (guix utils) (guix packages) (guix git-download) (guix build-system gnu) (gnu packages qt) (gnu packages pkg-config) (gnu packages autotools) (gnu packages compression) (gnu packages wget) (gnu packages crypto) (gnu packages libevent) (gnu packages sqlite) (gnu packages cpp) (gnu packages video) (gnu packages image)) (let ([version "4.6.1.0"] [commit "8d77d99ee3816f115c93e9aabbf4bf17d2a749c2"] [revision "0"]) (package (name "megasync") (version (git-version version revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/meganz/MEGAsync/") (commit commit) (recursive? #t))) ; for SDK (file-name (git-file-name name version)) (sha256 (base32 "0v2fvji9hs7valya0wx5qjx01c7yjld6nnp6m9gpxfkr30h5s5wb")) (modules '((guix build utils))))) (build-system gnu-build-system) (inputs `(("qtbase" ,qtbase-5))) (native-inputs `(("pkg-config" ,pkg-config) ("libtool" ,libtool) ("unzip" ,unzip) ("autoconf" ,autoconf) ("wget" ,wget) ("automake" ,automake) ;; ("curl" ,curl) ("libsodium" ,libsodium) ("libuv" ,libuv) ("zlib" ,zlib) ("sqlite" ,sqlite) ("libzen" ,libzen) ("libmediainfo" ,libmediainfo) ("freeimage" ,freeimage))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'configure 'remove-externals (lambda* (#:key outputs #:allow-other-keys) (delete-file-recursively "build") (substitute* "src/configure" [("FLAG_DISABLE_ZLIB=\"\"") "FLAG_DISABLE_ZLIB=\"-z\""] [("FLAG_RAW -w -s -v -u -o ") "FLAG_RAW -w -s -o "] [(" -u \\\\") " \\"] [(" -v \\\\") " \\"] [("\\$FLAG_LIBMEDIA") "-i"]) (substitute* "src/MEGASync/mega/contrib/build_sdk.sh" [(" sqlite_pkg \\$build_dir \\$install_dir") ""] [("\\$disable_freeimage") "1"] [("\\./configure") (string-append (which "bash") " ./configure")]) (chdir "src"))) (add-after 'configure 'run-qmake (lambda* (#:key outputs #:allow-other-keys) (invoke "qmake" "MEGA.pro") (invoke "lrelease" "MEGASync/MEGASync.pro")))))) (home-page "https://mega.io/sync/") (synopsis "Synopsis") (description "Description.") (license license:bsd-3)))
The build has a lot of external libraries it tries to download so I tried adjusting the configure
so they would skip getting build but still provide them as input
s; I may need to handle that differently or there may be flags I could, instead, pass rather than editing the files directly but I was just trying to get something to build, for starters.
If you try installing the file, you'll find that a second configure
file causes things to fail; the issue is that configure.ac
generates compile
, config.guess
, config.sub
, install-sh
, and missing
and, I assume, the second configure
script but it does so with #!/bin/sh
, rather than with the bash
that Guix is using.
Since these scripts get generated by configure.ac
– after the GNU build system has finished updating all locations of #!/bin/sh
–, it also means that it's in the middle of the configure
phase, as part of when src/configure
is being run: so I don't know how to update it, any. I'd…imagine(?) there's a way to set what shebang is used for these generated scripts but, like I mentioned, I'm unfamiliar with the tooling and wasn't able to figure it out.
Also – in case anyone knows or wants to help –, I'll put the log results here, in case there's anything that'd be helpful that I might miss in my unfamiliarity. It's just the configure portion as my computer is having trouble copying the whole thing and Reddit's code block seems to be having trouble with formatting:
starting phase `configure' source directory: "/tmp/guix-build-megasync-4.6.1.0-0.8d77d99.drv-0/source/src" (relative from build: ".") build directory: "/tmp/guix-build-megasync-4.6.1.0-0.8d77d99.drv-0/source/src" configure flags: ("CONFIG_SHELL=/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash" "SHELL=/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash" "--prefix=/gnu/store/w61fk4arlj3i1fpxm72pa0z00y9aaajb-megasync-4.6.1.0-0.8d77d99" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu") * Enabling Drive Notifications (libudev / wbemuuid). * Disabling external MediaInfo * Disabling external FreeImage * Disabling external libz. * Downloading software archives only. * Disabling OpenSSL * Storing local archive files in /tmp/guix-build-megasync-4.6.1.0-0.8d77d99.drv-0/source/src/archivesSuccessfully downloaded MEGA SDK dependencies! * Storing local archive files in /tmp/guix-build-megasync-4.6.1.0-0.8d77d99.drv-0/source/src/archives * Disabling external MediaInfo * Disabling external libz. * Using local files * Enabling Drive Notifications (libudev / wbemuuid). * Configure only * Disabling OpenSSL * Incremental build - skipping already built/downloaded dependencies * Installing into /tmp/guix-build-megasync-4.6.1.0-0.8d77d99.drv-0/source/src/MEGASync/mega/bindings/qt/3rdparty Configuring MEGA SDK autoreconf: Entering directory `.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 autoreconf: configure.ac: tracing autoreconf: running: libtoolize --copy --force libtoolize: putting auxiliary files in '.'. libtoolize: copying file './ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. libtoolize: copying file 'm4/libtool.m4' libtoolize: copying file 'm4/ltoptions.m4' libtoolize: copying file 'm4/ltsugar.m4' libtoolize: copying file 'm4/ltversion.m4' libtoolize: copying file 'm4/lt~obsolete.m4' autoreconf: running: /gnu/store/yk3zw1pqbs5wlf1lapf25986yjd0g736-autoconf-2.69/bin/autoconf --force autoreconf: running: /gnu/store/yk3zw1pqbs5wlf1lapf25986yjd0g736-autoconf-2.69/bin/autoheader --force autoreconf: running: automake --add-missing --copy --force-missing configure.ac:54: installing './compile' configure.ac:58: installing './config.guess' configure.ac:58: installing './config.sub' configure.ac:56: installing './install-sh' configure.ac:56: installing './missing' Makefile.am: installing './depcomp' bindings/python/include.am:2: installing './py-compile' Makefile.am:63: 'bindings/python/include.am' included from here parallel-tests: installing './test-driver' autoreconf: Leaving directory `.' running: ./configure --disable-shared --enable-static --disable-silent-rules --disable-curl-checks --disable-megaapi --with-cryptopp=/tmp/guix-build-megasync-4.6.1.0-0.8d77d99.drv-0/source/src/MEGASync/mega/bindings/qt/3rdparty --without-sodium --with-zlib=/tmp/guix-build-megasync-4.6.1.0-0.8d77d99.drv-0/source/src/MEGASync/mega/bindings/qt/3rdparty --with-sqlite=/tmp/guix-build-megasync-4.6.1.0-0.8d77d99.drv-0/source/src/MEGASync/mega/bindings/qt/3rdparty --with-cares=/tmp/guix-build-megasync-4.6.1.0-0.8d77d99.drv-0/source/src/MEGASync/mega/bindings/qt/3rdparty --with-curl=/tmp/guix-build-megasync-4.6.1.0-0.8d77d99.drv-0/source/src/MEGASync/mega/bindings/qt/3rdparty --without-freeimage --without-libuv --enable-drive-notifications --disable-posix-threads --disable-examples --prefix=/tmp/guix-build-megasync-4.6.1.0-0.8d77d99.drv-0/source/src/MEGASync/mega/bindings/qt/3rdparty ./contrib/build_sdk.sh: ./configure: /bin/sh: bad interpreter: No such file or directory ERROR! Please check log files. Exiting..