From 30c473e47bd95c4216d9ac13d4097ed070be9b79 Mon Sep 17 00:00:00 2001 From: Whovian9369 Date: Mon, 2 Sep 2024 02:11:36 -0400 Subject: [PATCH] Make `rom-properties` into Flake input :) --- flake.nix | 23 +-- home/home.nix | 1 + home/packages/rom-properties/package.nix | 152 ------------------ .../patches/fix_debug_paths.diff | 34 ---- .../patches/fix_getdents64_build.diff | 12 -- .../patches/fix_rp-stub_symlink.diff | 13 -- home/pkgs_and_programs.nix | 7 +- 7 files changed, 15 insertions(+), 227 deletions(-) delete mode 100644 home/packages/rom-properties/package.nix delete mode 100644 home/packages/rom-properties/patches/fix_debug_paths.diff delete mode 100644 home/packages/rom-properties/patches/fix_getdents64_build.diff delete mode 100644 home/packages/rom-properties/patches/fix_rp-stub_symlink.diff diff --git a/flake.nix b/flake.nix index d1df7a4..f174088 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + rom-properties = { + url = "github:Whovian9369/rom-properties-nix-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + ### Lix! Lix! Lix! lix = { @@ -103,7 +108,7 @@ # Lix lix, lix-module, # Added by me - agenix, home-manager, nix-index-database, xil, aaru, ... }: + agenix, home-manager, nix-index-database, xil, aaru, rom-properties, ... }: let pkgs = import nixpkgs { system = "x86_64-linux"; @@ -173,13 +178,11 @@ extraSpecialArgs = { system = "x86_64-linux"; inherit aaru; - inherit xil; - inherit nixpkgs; - pkgs = import nixpkgs { - system = "x86_64-linux"; - config.allowUnfree = true; - }; inherit agenix; + inherit nixpkgs; + inherit rom-properties; + inherit xil; + pkgs = import nixpkgs { system = "x86_64-linux"; config.allowUnfree = true; }; }; }; @@ -409,11 +412,8 @@ nxtik = pkgs.callPackage ./home/packages/nxtik/package.nix {}; ps3dec = pkgs.callPackage ./home/packages/ps3dec/package.nix {}; psfo = pkgs.callPackage ./home/packages/psfo/package.nix {}; - rom-properties = pkgs.callPackage ./home/packages/rom-properties/package.nix {}; sabretools = pkgs.callPackage ./home/packages/sabretools/package.nix {}; - # rom-properties_ninja = pkgs.callPackage ./home/packages/rom-properties/package.nix { useNinja = true; }; - # rom-properties_gtracker = pkgs.callPackage ./home/packages/rom-properties/package.nix { useTracker = true; }; - # rom-properties_ninja_gtracker = pkgs.callPackage ./home/packages/rom-properties/package.nix { useNinja = true; useTracker = true; }; + new_rclone = pkgs.rclone.overrideAttrs ( oldAttrs: { patches = [ ./home/packages/new_rclone/patches/rclone_8ffe3e462cbf5688c37c54009db09d8dcb486860.diff ]; } ); @@ -425,6 +425,7 @@ external_lix = lix.packages.x86_64-linux.nix; external_xil = xil.packages.x86_64-linux.xil; external_aaru = aaru.packages.x86_64-linux.git; + external_rom-properties = rom-properties.packages.x86_64-linux.default; }; }; } diff --git a/home/home.nix b/home/home.nix index 2e8b777..3cd7101 100644 --- a/home/home.nix +++ b/home/home.nix @@ -9,6 +9,7 @@ options, osConfig, pkgs, + rom-properties, specialArgs, system, xil diff --git a/home/packages/rom-properties/package.nix b/home/packages/rom-properties/package.nix deleted file mode 100644 index 0f1b7a6..0000000 --- a/home/packages/rom-properties/package.nix +++ /dev/null @@ -1,152 +0,0 @@ -{ - lib, - stdenv, - cmake, - curl, - fetchFromGitHub, - gettext, - glib, - libjpeg, - libpng, - libseccomp, - lz4, - lzo, - nettle, - pkg-config, - tinyxml-2, - zlib, - zstd, - - # Not really required afaik, but I like quieting the warnings :) - pcre2, - minizip-ng, - libselinux, - libsepol, - util-linux, - inih, - - # Use "Ninja" for the build. - useNinja ? false, - ninja, - - # Enable GNOME "Tracker". - useTracker ? false, - tracker -}: - -stdenv.mkDerivation { - pname = "rom-properties"; - version = "git"; - - src = fetchFromGitHub { - owner = "GerbilSoft"; - repo = "rom-properties"; - rev = "82ddbbe6574ba64d12c09229ff275bd9f5ba3f1e"; - hash = "sha256-Xj0xGcA/2hqk0gNLOOrqWxNjWONhH6J3VIF4Up/6NVU="; - }; - - nativeBuildInputs = [ - cmake - pkg-config - # So many "dev" package outputs, lol - nettle.dev - glib.dev - libselinux.dev - libsepol.dev - pcre2.dev - util-linux.dev - curl.dev - libjpeg.dev - libpng.dev - libseccomp.dev - lz4.dev - zlib.dev - zstd.dev - ] - ++ lib.optionals useNinja [ ninja ]; - - buildInputs = [ - gettext - lzo - tinyxml-2 - minizip-ng - inih - ] - ++ lib.optionals useTracker [ tracker ]; - - cmakeFlags = [ - (lib.cmakeBool "INSTALL_APPARMOR" false) - (lib.cmakeBool "ENABLE_DECRYPTION" true) - (lib.cmakeBool "ENABLE_EXTRA_SECURITY" true) - (lib.cmakeBool "ENABLE_JPEG" true) - (lib.cmakeBool "ENABLE_XML" true) - (lib.cmakeBool "ENABLE_UNICE68" true) - (lib.cmakeBool "ENABLE_LIBMSPACK" true) - (lib.cmakeBool "ENABLE_PVRTC" true) - (lib.cmakeBool "ENABLE_ZSTD" true) - (lib.cmakeBool "ENABLE_LZ4" true) - (lib.cmakeBool "ENABLE_LZO" true) - (lib.cmakeBool "ENABLE_NLS" true) - (lib.cmakeBool "ENABLE_OPENMP" true) - ] ++ lib.optionals useTracker [ (lib.cmakeFeature "TRACKER_INSTALL_API_VERSION" "3") ]; - - patches = [ - ./patches/fix_debug_paths.diff - ./patches/fix_getdents64_build.diff - ./patches/fix_rp-stub_symlink.diff - ]; - - /* - About "patches": - "fix_debug_paths.diff" is needed to properly have some correct debug - paths, due to "cmake"'s weird path issues. - (See below references for "fix_rp-stub_symlink.diff".) - - "fix_getdents64_build.diff" is needed to properly complete and then run - the build as it's not being detected automatically. - (Maybe it's an issue with WSL?) - - "fix_rp-stub_symlink.diff" is needed to properly symlink - `result/libexec/rp-thumbnail` to `result/bin/rp-stub` due to the odd - double-path bug as described in - https://github.com/NixOS/nixpkgs/issues/144170 - # CMake incorrect absolute include/lib paths tracking issue - https://github.com/NixOS/nixpkgs/pull/172347 and - # cmake: add check-pc-files hook to check broken pc files - https://github.com/NixOS/nixpkgs/pull/247474 - # cmake: make check-pc-files hook also check .cmake files - */ - - meta = { - description = "ROM Properties Page shell extension"; - homepage = "https://github.com/GerbilSoft/rom-properties"; - license = lib.licenses.gpl2Only; - maintainers = with lib.maintainers; [ ]; - mainProgram = "rpcli"; - platforms = lib.platforms.all; - }; -} - -################################################################### - -/* NOTES - - *** ROM Properties Page Shell Extension v2.3.0+ *** - Build Summary: - - Target CPU architecture: amd64 - - Building these UI frontends: - - Building command-line frontend: Yes - - GNOME Tracker API version: (none) - - libromdata is built as: shared library (.so) - - Security mechanism: seccomp() - - Decryption functionality: Enabled - - XML parsing: Enabled (system) - - PVRTC decoder: Enabled - - ZSTD decompression: Enabled (system) - - LZ4 decompression: Enabled (system) - - LZO decompression: Enabled (system) - Building these third-party libraries from extlib: - - minizip-ng - - inih - -*/ diff --git a/home/packages/rom-properties/patches/fix_debug_paths.diff b/home/packages/rom-properties/patches/fix_debug_paths.diff deleted file mode 100644 index 96b6766..0000000 --- a/home/packages/rom-properties/patches/fix_debug_paths.diff +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/cmake/macros/DirInstallPaths.cmake b/cmake/macros/DirInstallPaths.cmake -index 7aefd5de6..1b180e3d2 100644 ---- a/cmake/macros/DirInstallPaths.cmake -+++ b/cmake/macros/DirInstallPaths.cmake -@@ -65,10 +65,10 @@ IF(UNIX AND NOT APPLE) - SET(DIR_INSTALL_XDG_MIME "share/mime") - SET(DIR_INSTALL_XDG_DESKTOP "share/applications") - SET(DIR_INSTALL_XDG_APPSTREAM "share/metainfo") -- SET(DIR_INSTALL_EXE_DEBUG "lib/debug/${CMAKE_INSTALL_PREFIX}/${DIR_INSTALL_EXE}") -- SET(DIR_INSTALL_DLL_DEBUG "lib/debug/${CMAKE_INSTALL_PREFIX}/${DIR_INSTALL_DLL}") -- SET(DIR_INSTALL_LIB_DEBUG "lib/debug/${CMAKE_INSTALL_PREFIX}/${DIR_INSTALL_LIB}") -- SET(DIR_INSTALL_LIBEXEC_DEBUG "lib/debug/${CMAKE_INSTALL_PREFIX}/${DIR_INSTALL_LIBEXEC}") -+ SET(DIR_INSTALL_EXE_DEBUG "lib/debug/bin") -+ SET(DIR_INSTALL_DLL_DEBUG "lib/debug/lib") -+ SET(DIR_INSTALL_LIB_DEBUG "lib/debug/lib") -+ SET(DIR_INSTALL_LIBEXEC_DEBUG "lib/debug/libexec") - - # AppArmor profile directory - SET(DIR_INSTALL_APPARMOR "/etc/apparmor.d") -@@ -88,10 +88,10 @@ ELSEIF(APPLE) - UNSET(DIR_INSTALL_XDG_MIME) - UNSET(DIR_INSTALL_XDG_DESKTOP) - UNSET(DIR_INSTALL_XDG_APPSTREAM) -- SET(DIR_INSTALL_EXE_DEBUG "lib/debug/${CMAKE_INSTALL_PREFIX}/${DIR_INSTALL_EXE}") -- SET(DIR_INSTALL_DLL_DEBUG "lib/debug/${CMAKE_INSTALL_PREFIX}/${DIR_INSTALL_DLL}") -- SET(DIR_INSTALL_LIB_DEBUG "lib/debug/${CMAKE_INSTALL_PREFIX}/${DIR_INSTALL_LIB}") -- SET(DIR_INSTALL_LIBEXEC_DEBUG "lib/debug/${CMAKE_INSTALL_PREFIX}/${DIR_INSTALL_LIBEXEC}") -+ SET(DIR_INSTALL_EXE_DEBUG "lib/debug/bin") -+ SET(DIR_INSTALL_DLL_DEBUG "lib/debug/lib") -+ SET(DIR_INSTALL_LIB_DEBUG "lib/debug/lib") -+ SET(DIR_INSTALL_LIBEXEC_DEBUG "lib/debug/libexec") - ELSEIF(WIN32) - # Win32-style install paths. - # Files are installed relative to root, since the diff --git a/home/packages/rom-properties/patches/fix_getdents64_build.diff b/home/packages/rom-properties/patches/fix_getdents64_build.diff deleted file mode 100644 index f4b2867..0000000 --- a/home/packages/rom-properties/patches/fix_getdents64_build.diff +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/librpsecure/os-secure_linux.c b/src/librpsecure/os-secure_linux.c -index bd245ff40..0a4c7159f 100644 ---- a/src/librpsecure/os-secure_linux.c -+++ b/src/librpsecure/os-secure_linux.c -@@ -71,6 +71,7 @@ int rp_secure_enable(rp_secure_param_t param) - SCMP_SYS(read), - SCMP_SYS(rt_sigreturn), - SCMP_SYS(write), -+ SCMP_SYS(getdents64), - - SCMP_SYS(access), - SCMP_SYS(faccessat), // Linux on aarch64 does not have an access() syscall diff --git a/home/packages/rom-properties/patches/fix_rp-stub_symlink.diff b/home/packages/rom-properties/patches/fix_rp-stub_symlink.diff deleted file mode 100644 index 19ad012..0000000 --- a/home/packages/rom-properties/patches/fix_rp-stub_symlink.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/rp-stub/CMakeLists.txt b/src/rp-stub/CMakeLists.txt -index acad9bdcd..d611b38cf 100644 ---- a/src/rp-stub/CMakeLists.txt -+++ b/src/rp-stub/CMakeLists.txt -@@ -39,7 +39,7 @@ INCLUDE(DirInstallPaths) - # Create symlinks for rp-thumbnail and rp-config. - # Reference: https://stackoverflow.com/questions/34578362/how-can-i-package-a-symlink-with-cpack - ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD -- COMMAND ln -sf "${CMAKE_INSTALL_PREFIX}/${DIR_INSTALL_EXE}/${PROJECT_NAME}" rp-thumbnail -+ COMMAND ln -sf "${DIR_INSTALL_EXE}/${PROJECT_NAME}" rp-thumbnail - WORKING_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" - VERBATIM - ) diff --git a/home/pkgs_and_programs.nix b/home/pkgs_and_programs.nix index ab36a06..367901a 100644 --- a/home/pkgs_and_programs.nix +++ b/home/pkgs_and_programs.nix @@ -1,5 +1,6 @@ { aaru, + rom-properties, agenix, pkgs, system, @@ -17,11 +18,7 @@ let irdkit = pkgs.callPackage ./packages/irdkit/package.nix {}; nxtik = pkgs.callPackage ./packages/nxtik/package.nix {}; ps3dec = pkgs.callPackage ./packages/ps3dec/package.nix {}; - rom-properties = pkgs.callPackage ./packages/rom-properties/package.nix {}; sabretools = pkgs.callPackage ./packages/sabretools/package.nix {}; - # rom-properties_ninja = pkgs.callPackage ./package.nix { useNinja = true; }; - # rom-properties_gtracker = pkgs.callPackage ./package.nix { useTracker = true; }; - # rom-properties_ninja_gtracker = pkgs.callPackage ./package.nix { useNinja = true; useTracker = true; }; new_rclone = pkgs.rclone.overrideAttrs (oldAttrs: rec { patches = [ ./packages/new_rclone/patches/rclone_8ffe3e462cbf5688c37c54009db09d8dcb486860.diff ]; } @@ -148,7 +145,6 @@ in my_packages.nxtik my_packages.ps3dec - my_packages.rom-properties my_packages.sabretools my_packages.unnix_script # It's a one-line bash script # my_packages.hactoolnet @@ -156,6 +152,7 @@ in agenix.packages.${system}.default xil.packages.${system}.xil aaru.packages.${system}.git + rom-properties.packages.x86_64-linux.default ]; # Disabled Packages