2022-06-22 21:35:16 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
2024-02-10 16:23:29 +00:00
|
|
|
fetchpatch,
|
2022-06-22 21:35:16 +00:00
|
|
|
gitUpdater,
|
|
|
|
cmake,
|
|
|
|
pkg-config,
|
|
|
|
python3,
|
|
|
|
SDL2,
|
|
|
|
fontconfig,
|
|
|
|
gtk3,
|
2024-04-26 20:24:03 +00:00
|
|
|
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;
|
2024-07-14 10:59:26 +00:00
|
|
|
hash = "sha256-sKDDOPpCagk7rBRlMlZhx+RYYbtoLzJsrnL8qKZMKW8=";
|
2022-06-22 21:35:16 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2024-02-10 16:23:29 +00:00
|
|
|
patches = [
|
|
|
|
# Fix gcc-13 build failure
|
|
|
|
(fetchpatch {
|
|
|
|
name = "gcc-13.patch";
|
|
|
|
url = "https://github.com/OpenBoardView/OpenBoardView/commit/b03d0f69ec1611f5eb93f81291b4ba8c58cd29eb.patch";
|
|
|
|
hash = "sha256-Hp7KgzulPC2bPtRsd6HJrTLu0oVoQEoBHl0p2DcOLQw=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-04-26 20:24:03 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
wrapGAppsHook3
|
2023-02-03 21:01:14 +00:00
|
|
|
];
|
|
|
|
buildInputs =
|
2024-12-10 19:26:33 +00:00
|
|
|
[
|
|
|
|
SDL2
|
2023-02-03 21:01:14 +00:00
|
|
|
fontconfig
|
2024-12-10 19:26:33 +00:00
|
|
|
gtk3
|
|
|
|
]
|
2023-02-03 21:01:14 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-12-10 19:26:33 +00:00
|
|
|
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";
|
2024-03-19 02:14:51 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|