nixpkgs/pkgs/by-name/pr/pragtical/package.nix
2024-04-25 22:53:46 +02:00

87 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cacert,
meson,
ninja,
pkg-config,
freetype,
libgit2,
libuchardet,
libzip,
lua5_4,
luajit,
mbedtls_2,
pcre2,
SDL2,
zlib,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "pragtical";
version = "3.3.1";
pluginManagerVersion = "1.2.9";
src = fetchFromGitHub {
owner = "pragtical";
repo = "pragtical";
rev = "v${finalAttrs.version}";
fetchSubmodules = true;
# also fetch required git submodules
postFetch = ''
cd "$out"
export NIX_SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
substituteInPlace subprojects/ppm.wrap \
--replace-fail 'revision = head' 'revision = v${finalAttrs.pluginManagerVersion}'
${lib.getExe meson} subprojects download \
colors plugins ppm
find subprojects -type d -name .git -prune -execdir rm -r {} +
'';
hash = "sha256-T0IHpfMfx4P84RyBLtaYNead6a7cID2cUYwkyNnYMgc=";
};
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
freetype
libgit2
libuchardet
libzip
lua5_4
luajit
mbedtls_2
pcre2
SDL2
zlib
];
# workaround for `libmbedx509.so.1, libmbedcrypto.so.7: error adding symbols: DSO missing from command line`
env.NIX_LDFLAGS = "-lmbedx509 -lmbedcrypto";
mesonFlags = [ "-Duse_system_lua=true" ];
meta = {
changelog = "https://github.com/pragtical/pragtical/blob/${finalAttrs.src.rev}/changelog.md";
description = "A practical and pragmatic code editor";
homepage = "https://pragtical.dev";
license = lib.licenses.mit;
mainProgram = "pragtical";
maintainers = with lib.maintainers; [
suhr
tomasajt
];
platforms = lib.platforms.linux;
};
})