From 5e8556cbc2249b2cfc86ee8328d21636a45c8a9d Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 13 Jun 2023 12:52:19 +0200 Subject: [PATCH 1/2] qdjango: init at unstable-2018-03-07 --- .../development/libraries/qdjango/default.nix | 60 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 62 insertions(+) create mode 100644 pkgs/development/libraries/qdjango/default.nix diff --git a/pkgs/development/libraries/qdjango/default.nix b/pkgs/development/libraries/qdjango/default.nix new file mode 100644 index 000000000000..5793a62969b0 --- /dev/null +++ b/pkgs/development/libraries/qdjango/default.nix @@ -0,0 +1,60 @@ +{ stdenv +, lib +, fetchFromGitHub +, testers +, doxygen +, qmake +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "qdjango"; + version = "unstable-2018-03-07"; + + src = fetchFromGitHub { + owner = "jlaine"; + repo = "qdjango"; + rev = "bda4755ece9d173a67b880e498027fcdc51598a8"; + hash = "sha256-5MfRfsIlv73VMvKMBCLviXFovyGH0On5ukLIEy7zwkk="; + }; + + outputs = [ "out" "dev" "doc" ]; + + postPatch = '' + # HTML docs depend on regular docs + substituteInPlace qdjango.pro \ + --replace 'dist.depends = docs' 'htmldocs.depends = docs' + ''; + + qmakeFlags = [ + # Uses Qt testing infrastructure via QMake CONFIG testcase, + # defaults to installing all testcase targets under Qt prefix + # https://github.com/qt/qtbase/blob/29400a683f96867133b28299c0d0bd6bcf40df35/mkspecs/features/testcase.prf#L110-L120 + "CONFIG+=no_testcase_installs" + + # Qmake-generated pkg-config files default to Qt prefix + "QMAKE_PKGCONFIG_PREFIX=${placeholder "out"}" + ]; + + nativeBuildInputs = [ + doxygen + qmake + ]; + + dontWrapQtApps = true; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + + meta = with lib; { + description = "Qt-based C++ web framework"; + homepage = "https://github.com/jlaine/qdjango"; + license = licenses.lgpl21Plus; + maintainers = with maintainers; [ OPNA2608 ]; + platforms = platforms.all; + pkgConfigModules = [ + "qdjango-db" + "qdjango-http" + ]; + }; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9bb2c80d05f2..78560100c011 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23764,6 +23764,8 @@ with pkgs; qbs = libsForQt5.callPackage ../development/tools/build-managers/qbs { }; + qdjango = libsForQt5.callPackage ../development/libraries/qdjango { }; + qimageblitz = callPackage ../development/libraries/qimageblitz { }; qolibri = libsForQt5.callPackage ../applications/misc/qolibri { }; From 9231527e6b8dfa047a3ab9a5c3a11f10c656fe0c Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Thu, 15 Jun 2023 19:19:40 +0200 Subject: [PATCH 2/2] qdjango: Potential test fix for Darwin --- pkgs/development/libraries/qdjango/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/libraries/qdjango/default.nix b/pkgs/development/libraries/qdjango/default.nix index 5793a62969b0..8036373a826a 100644 --- a/pkgs/development/libraries/qdjango/default.nix +++ b/pkgs/development/libraries/qdjango/default.nix @@ -23,6 +23,11 @@ stdenv.mkDerivation (finalAttrs: { # HTML docs depend on regular docs substituteInPlace qdjango.pro \ --replace 'dist.depends = docs' 'htmldocs.depends = docs' + '' + lib.optionalString stdenv.hostPlatform.isDarwin '' + # tst_Auth:constIterator (tests/db/auth/tst_auth.cpp:624) fails on Darwin? + # QVERIFY(&*(it += 2) == 0) evals to false + substituteInPlace tests/db/db.pro \ + --replace 'auth' "" ''; qmakeFlags = [ @@ -44,6 +49,14 @@ stdenv.mkDerivation (finalAttrs: { doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + preCheck = lib.optionalString stdenv.hostPlatform.isDarwin '' + # at this point in the build, install_name for dylibs hasn't been patched yet so we need to set the library path. + # for some reason, this doesn't work when just exporting the needed paths even though the autogenerated wrappers + # should at most prepend paths? just patch them into the wrappers instead + substituteInPlace $(find tests -name target_wrapper.sh) \ + --replace 'DYLD_LIBRARY_PATH=' "DYLD_LIBRARY_PATH=$PWD/src/db:$PWD/src/http:" + ''; + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; meta = with lib; {