nixpkgs/pkgs/by-name/op/openboardview/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

91 lines
2.0 KiB
Nix
Raw Normal View History

2022-06-22 21:35:16 +00:00
{
stdenv,
lib,
fetchFromGitHub,
fetchpatch,
2022-06-22 21:35:16 +00:00
gitUpdater,
cmake,
pkg-config,
python3,
SDL2,
fontconfig,
gtk3,
wrapGAppsHook3,
2023-02-03 21:01:14 +00:00
darwin,
2022-06-22 21:35:16 +00:00
}:
2023-02-03 21:01:14 +00:00
let
inherit (darwin.apple_sdk.frameworks) Cocoa;
in
2022-06-22 21:35:16 +00:00
stdenv.mkDerivation rec {
pname = "openboardview";
2023-02-23 22:33:55 +00:00
version = "9.95.0";
2022-06-22 21:35:16 +00:00
src = fetchFromGitHub {
owner = "OpenBoardView";
repo = "OpenBoardView";
rev = version;
hash = "sha256-sKDDOPpCagk7rBRlMlZhx+RYYbtoLzJsrnL8qKZMKW8=";
2022-06-22 21:35:16 +00:00
fetchSubmodules = true;
};
patches = [
# Fix gcc-13 build failure
(fetchpatch {
name = "gcc-13.patch";
url = "https://github.com/OpenBoardView/OpenBoardView/commit/b03d0f69ec1611f5eb93f81291b4ba8c58cd29eb.patch";
hash = "sha256-Hp7KgzulPC2bPtRsd6HJrTLu0oVoQEoBHl0p2DcOLQw=";
})
];
nativeBuildInputs = [
cmake
pkg-config
python3
wrapGAppsHook3
2023-02-03 21:01:14 +00:00
];
buildInputs =
[
SDL2
2023-02-03 21:01:14 +00:00
fontconfig
gtk3
]
2023-02-03 21:01:14 +00:00
++ lib.optionals stdenv.hostPlatform.isDarwin [
Cocoa
];
2022-06-22 21:35:16 +00:00
postPatch = ''
substituteInPlace src/openboardview/CMakeLists.txt \
--replace "SDL2::SDL2main" ""
2023-02-03 21:01:14 +00:00
substituteInPlace CMakeLists.txt --replace "fixup_bundle" "#fixup_bundle"
2022-06-22 21:35:16 +00:00
'';
cmakeFlags = [
"-DGLAD_REPRODUCIBLE=On"
];
dontWrapGApps = true;
2023-02-03 21:01:14 +00:00
postFixup =
lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p "$out/Applications"
mv "$out/openboardview.app" "$out/Applications/OpenBoardView.app"
''
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
wrapGApp "$out/bin/${pname}" \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gtk3 ]}
2022-06-22 21:35:16 +00:00
'';
passthru.updateScript = gitUpdater {
ignoredVersions = ''.*\.90\..*'';
};
meta = with lib; {
description = "Linux SDL/ImGui edition software for viewing .brd files";
mainProgram = "openboardview";
2022-06-22 21:35:16 +00:00
homepage = "https://github.com/OpenBoardView/OpenBoardView";
license = licenses.mit;
2023-02-03 21:01:14 +00:00
platforms = platforms.unix;
2022-06-22 21:35:16 +00:00
maintainers = with maintainers; [ k3a ];
};
}