qzdl: init at unstable-2023-04-04

This commit is contained in:
Azat Bahawi 2023-08-01 15:05:59 +03:00
parent 2283bf968f
commit cc5cd006db
No known key found for this signature in database
GPG key ID: C8C6BDDB3847F72B
3 changed files with 103 additions and 0 deletions

View file

@ -0,0 +1,65 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, inih
, ninja
, pkg-config
, qtbase
, wrapQtAppsHook
, makeDesktopItem
, copyDesktopItems
}:
stdenv.mkDerivation rec {
pname = "qzdl";
version = "unstable-2023-04-04";
src = fetchFromGitHub {
owner = "qbasicer";
repo = "qzdl";
rev = "44aaec0182e781a3cef373e5c795c9dbd9cd61bb";
hash = "sha256-K/mJQb7uO2H94krWJIJtFRYd6BAe2TX1xBt6fGBb1tA=";
};
patches = [
./non-bundled-inih.patch
];
nativeBuildInputs = [
cmake
copyDesktopItems
ninja
pkg-config
wrapQtAppsHook
];
buildInputs = [
inih
qtbase
];
postInstall = ''
install -Dm644 $src/res/zdl3.svg $out/share/icons/hicolor/scalable/apps/zdl3.svg
'';
desktopItems = [
(makeDesktopItem {
name = "zdl3";
exec = "zdl %U";
icon = "zdl3";
desktopName = "ZDL";
genericName = "A ZDoom WAD Launcher";
categories = [ "Game" ];
})
];
meta = with lib; {
description = "A ZDoom WAD Launcher";
homepage = "https://zdl.vectec.net";
license = licenses.gpl3Only;
inherit (qtbase.meta) platforms;
maintainers = with maintainers; [ azahi ];
mainProgram = "zdl";
};
}

View file

@ -0,0 +1,36 @@
diff --git i/CMakeLists.txt w/CMakeLists.txt
index 10a8fb6..dcab540 100644
--- i/CMakeLists.txt
+++ w/CMakeLists.txt
@@ -6,16 +6,8 @@ set(CMAKE_AUTOMOC ON)
project(qzdl LANGUAGES C CXX)
find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
-include(FetchContent)
-FetchContent_Declare(
- inih
- GIT_REPOSITORY https://github.com/benhoyt/inih.git
- GIT_TAG r44
-)
-FetchContent_GetProperties(inih)
-if (NOT inih_POPULATED)
- FetchContent_Populate(inih)
-endif()
+find_package(PkgConfig)
+pkg_check_modules(INIH inih)
add_executable(
zdl
@@ -45,9 +37,8 @@ add_executable(
libwad.cpp
qzdl.cpp
${PROJECT_SOURCE_DIR}/zdlconf/zdlconf.cpp
- ${inih_SOURCE_DIR}/ini.c
)
-target_include_directories(zdl PRIVATE ${PROJECT_SOURCE_DIR}/zdlconf)
-target_include_directories(zdl PRIVATE ${inih_SOURCE_DIR})
-target_link_libraries(zdl Qt5::Core Qt5::Widgets)
+target_include_directories(zdl PRIVATE ${PROJECT_SOURCE_DIR}/zdlconf ${INIH_INCLUDEDIR})
+target_link_libraries(zdl Qt5::Core Qt5::Widgets ${INIH_LDFLAGS})
+install(TARGETS zdl RUNTIME DESTINATION "bin")

View file

@ -40449,6 +40449,8 @@ with pkgs;
qperf = callPackage ../os-specific/linux/qperf { };
qzdl = libsForQt5.callPackage ../games/qzdl { };
rates = callPackage ../tools/misc/rates {
inherit (darwin.apple_sdk.frameworks) Security;
};