diff --git a/default.nix b/default.nix index 7c55593..3a36797 100644 --- a/default.nix +++ b/default.nix @@ -14,7 +14,6 @@ modules = import ./modules; # NixOS modules overlays = import ./overlays; # nixpkgs overlays - gtk-gjs = pkgs.callPackage ./pkgs/gtk-gjs { }; naver-whale = pkgs.libsForQt5.callPackage ./pkgs/naver-whale { }; # ... } diff --git a/pkgs/gtk-gjs/default.nix b/pkgs/gtk-gjs/default.nix deleted file mode 100644 index 3fa296d..0000000 --- a/pkgs/gtk-gjs/default.nix +++ /dev/null @@ -1,159 +0,0 @@ -{ fetchurl -, lib -, stdenv -, meson -, mesonEmulatorHook -, ninja -, pkg-config -, gnome -, gtk3 -, atk -, gobject-introspection -, spidermonkey_102 -, pango -, cairo -, readline -, libsysprof-capture -, glib -, libxml2 -, dbus -, gdk-pixbuf -, networkmanager -, harfbuzz -, makeWrapper -, wrapGAppsHook -, which -, xvfb-run -, nixosTests -, upower -, glib-networking -, gtk-layer-shell -}: - -let - testDeps = [ - gtk3 atk pango.out gdk-pixbuf harfbuzz - ]; -in stdenv.mkDerivation rec { - pname = "gjs"; - version = "1.76.2"; - - outputs = [ "out" "dev" "installedTests" ]; - - src = fetchurl { - url = "mirror://gnome/sources/gjs/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "sha256-99jJ1lPqb9eK/kpQcg4EaqK/wHj9pjXdEwZ90ZnGJdQ="; - }; - - patches = [ - # Hard-code various paths - ./fix-paths.patch - - # Allow installing installed tests to a separate output. - ./installed-tests-path.patch - ]; - - nativeBuildInputs = [ - meson - ninja - pkg-config - makeWrapper - wrapGAppsHook - which # for locale detection - libxml2 # for xml-stripblanks - dbus # for dbus-run-session - gobject-introspection - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; - - buildInputs = [ - cairo - upower - gnome.gnome-bluetooth - gtk-layer-shell - glib-networking - networkmanager - readline - libsysprof-capture - spidermonkey_102 - ]; - - nativeCheckInputs = [ - xvfb-run - ] ++ testDeps; - - propagatedBuildInputs = [ - glib - ]; - - mesonFlags = [ - "-Dinstalled_test_prefix=${placeholder "installedTests"}" - ] ++ lib.optionals (!stdenv.isLinux || stdenv.hostPlatform.isMusl) [ - "-Dprofiler=disabled" - ]; - - doCheck = !stdenv.isDarwin; - - postPatch = '' - patchShebangs build/choose-tests-locale.sh - substituteInPlace installed-tests/debugger-test.sh --subst-var-by gjsConsole $out/bin/gjs-console - '' + lib.optionalString stdenv.hostPlatform.isMusl '' - substituteInPlace installed-tests/js/meson.build \ - --replace "'Encoding'," "#'Encoding'," - ''; - - preCheck = '' - # Our gobject-introspection patches make the shared library paths absolute - # in the GIR files. When running tests, the library is not yet installed, - # though, so we need to replace the absolute path with a local one during build. - # We are using a symlink that will be overridden during installation. - mkdir -p $out/lib $installedTests/libexec/installed-tests/gjs - ln -s $PWD/libgjs.so.0 $out/lib/libgjs.so.0 - ln -s $PWD/installed-tests/js/libgimarshallingtests.so $installedTests/libexec/installed-tests/gjs/libgimarshallingtests.so - ln -s $PWD/installed-tests/js/libgjstesttools/libgjstesttools.so $installedTests/libexec/installed-tests/gjs/libgjstesttools.so - ln -s $PWD/installed-tests/js/libregress.so $installedTests/libexec/installed-tests/gjs/libregress.so - ln -s $PWD/installed-tests/js/libwarnlib.so $installedTests/libexec/installed-tests/gjs/libwarnlib.so - ''; - - postInstall = '' - # TODO: make the glib setup hook handle moving the schemas in other outputs. - installedTestsSchemaDatadir="$installedTests/share/gsettings-schemas/${pname}-${version}" - mkdir -p "$installedTestsSchemaDatadir" - mv "$installedTests/share/glib-2.0" "$installedTestsSchemaDatadir" - ''; - - postFixup = '' - wrapProgram "$installedTests/libexec/installed-tests/gjs/minijasmine" \ - --prefix XDG_DATA_DIRS : "$installedTestsSchemaDatadir" \ - --prefix GI_TYPELIB_PATH : "${lib.makeSearchPath "lib/girepository-1.0" testDeps}" - ''; - - checkPhase = '' - runHook preCheck - xvfb-run -s '-screen 0 800x600x24' \ - meson test --print-errorlogs - runHook postCheck - ''; - - separateDebugInfo = stdenv.isLinux; - - passthru = { - tests = { - installed-tests = nixosTests.installed-tests.gjs; - }; - - updateScript = gnome.updateScript { - packageName = "gjs"; - versionPolicy = "odd-unstable"; - }; - }; - - meta = with lib; { - description = "JavaScript bindings for GNOME"; - homepage = "https://gitlab.gnome.org/GNOME/gjs/blob/master/doc/Home.md"; - license = licenses.lgpl2Plus; - maintainers = teams.gnome.members; - platforms = platforms.unix; - }; -} diff --git a/pkgs/gtk-gjs/fix-paths.patch b/pkgs/gtk-gjs/fix-paths.patch deleted file mode 100644 index 5ca5372..0000000 --- a/pkgs/gtk-gjs/fix-paths.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/installed-tests/debugger-test.sh b/installed-tests/debugger-test.sh -index 0d118490..54c5507e 100755 ---- a/installed-tests/debugger-test.sh -+++ b/installed-tests/debugger-test.sh -@@ -3,7 +3,7 @@ - if test "$GJS_USE_UNINSTALLED_FILES" = "1"; then - gjs="$TOP_BUILDDIR/gjs-console" - else -- gjs=gjs-console -+ gjs=@gjsConsole@ - fi - - echo 1..1 diff --git a/pkgs/gtk-gjs/installed-tests-path.patch b/pkgs/gtk-gjs/installed-tests-path.patch deleted file mode 100644 index 09cd8ea..0000000 --- a/pkgs/gtk-gjs/installed-tests-path.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/installed-tests/meson.build b/installed-tests/meson.build -index 04c7910f..9647908c 100644 ---- a/installed-tests/meson.build -+++ b/installed-tests/meson.build -@@ -1,7 +1,7 @@ - ### Installed tests ############################################################ - --installed_tests_execdir = get_option('prefix') / get_option('libexecdir') / 'installed-tests' / meson.project_name() --installed_tests_metadir = abs_datadir / 'installed-tests' / meson.project_name() -+installed_tests_execdir = get_option('installed_test_prefix') / 'libexec' / 'installed-tests' / meson.project_name() -+installed_tests_metadir = get_option('installed_test_prefix') / 'share' / 'installed-tests' / meson.project_name() - - # Simple shell script tests # - -diff --git a/meson.build b/meson.build -index 9ab29475..42ffe07f 100644 ---- a/meson.build -+++ b/meson.build -@@ -557,7 +557,7 @@ install_data('installed-tests/extra/lsan.supp', - install_dir: get_option('datadir') / api_name / 'lsan') - - if get_option('installed_tests') -- schemadir = abs_datadir / 'glib-2.0' / 'schemas' -+ schemadir = get_option('installed_test_prefix') / 'share' / 'glib-2.0' / 'schemas' - install_data('installed-tests/js/org.gnome.GjsTest.gschema.xml', install_dir: schemadir) - meson.add_install_script('build/compile-gschemas.py', schemadir) - endif -diff --git a/meson_options.txt b/meson_options.txt -index 825ba77a..21f0323c 100644 ---- a/meson_options.txt -+++ b/meson_options.txt -@@ -25,3 +25,5 @@ option('skip_gtk_tests', type: 'boolean', value: false, - description: 'Skip tests that need a display connection') - option('verbose_logs', type: 'boolean', value: false, - description: 'Enable extra log messages that may decrease performance (not allowed in release builds)') -+option('installed_test_prefix', type: 'string', value: '', -+ description: 'Prefix for installed tests')