venmic: init
This commit is contained in:
@@ -18,8 +18,8 @@ python3Packages.buildPythonApplication rec {
|
|||||||
hash = "sha256-a+4DGWBD5XLaNAfTN/fmI/gALe76SCoWrnjyglNhVPY=";
|
hash = "sha256-a+4DGWBD5XLaNAfTN/fmI/gALe76SCoWrnjyglNhVPY=";
|
||||||
};
|
};
|
||||||
|
|
||||||
build-system = with python3Packages; [
|
build-system = [
|
||||||
setuptools
|
python3Packages.setuptools
|
||||||
];
|
];
|
||||||
|
|
||||||
dependencies = [];
|
dependencies = [];
|
||||||
|
|||||||
101
pkgs/venmic/default.nix
Normal file
101
pkgs/venmic/default.nix
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
{ cmake
|
||||||
|
, cacert
|
||||||
|
, cpm-cmake
|
||||||
|
, git
|
||||||
|
, pkg-config
|
||||||
|
, pulseaudio
|
||||||
|
, pipewire
|
||||||
|
, fetchFromGitHub
|
||||||
|
, stdenv
|
||||||
|
}:
|
||||||
|
|
||||||
|
# See
|
||||||
|
# https://github.com/NixOS/nixpkgs/blob/nixos-25.05/pkgs/development/compilers/codon/default.nix#L136
|
||||||
|
# for an example of an CPM/CMake project built with Nix.
|
||||||
|
|
||||||
|
let
|
||||||
|
version = "6.1.0";
|
||||||
|
depsDir = "deps";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "Vencord";
|
||||||
|
repo = "venmic";
|
||||||
|
rev = "v${version}";
|
||||||
|
hash = "sha256-0UP8a2bfhWGsB2Lg/GeIBu4zw1zHnXbitT8vU+DLeEY=";
|
||||||
|
};
|
||||||
|
|
||||||
|
venmic-deps = stdenv.mkDerivation {
|
||||||
|
name = "venmic-deps-${version}.tar.gz";
|
||||||
|
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
cmake
|
||||||
|
cacert
|
||||||
|
cpm-cmake
|
||||||
|
git
|
||||||
|
# Pkg-config is implicitly used by CMake and will fail to find libs
|
||||||
|
# without it.
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
pulseaudio
|
||||||
|
pipewire
|
||||||
|
];
|
||||||
|
|
||||||
|
dontBuild = true;
|
||||||
|
|
||||||
|
cmakeFlags = [
|
||||||
|
"-DCPM_DOWNLOAD_ALL=ON"
|
||||||
|
"-DCPM_SOURCE_CACHE=${depsDir}"
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
# Build a reproducible tarball, per
|
||||||
|
# https://reproducible-builds.org/docs/archives.
|
||||||
|
tar --owner=0 --group=0 --numeric-owner --format=gnu \
|
||||||
|
--sort=name --mtime="@$SOURCE_DATE_EPOCH" \
|
||||||
|
-czf $out \
|
||||||
|
"${depsDir}"
|
||||||
|
'';
|
||||||
|
|
||||||
|
outputHashAlgo = "sha256";
|
||||||
|
outputHash = "sha256-KIkf3bg1+vbGaYo/QTtOF7bUQVZH8vrBPNejk3EbNuA=";
|
||||||
|
};
|
||||||
|
|
||||||
|
venmic = stdenv.mkDerivation {
|
||||||
|
pname = "venmic";
|
||||||
|
inherit version src;
|
||||||
|
|
||||||
|
postUnpack = ''
|
||||||
|
# Bring in the cached CPM deps.
|
||||||
|
mkdir -p $sourceRoot/build
|
||||||
|
tar xzf ${venmic-deps} -C $sourceRoot/build
|
||||||
|
|
||||||
|
# Bring in CPM itself — Venmic tries to download it itself.
|
||||||
|
rm $sourceRoot/cmake/cpm.cmake
|
||||||
|
ln -s ${cpm-cmake}/share/cpm/CPM.cmake $sourceRoot/cmake/cpm.cmake
|
||||||
|
'';
|
||||||
|
|
||||||
|
cmakeFlags = [
|
||||||
|
"-DCPM_SOURCE_CACHE=${depsDir}"
|
||||||
|
"-Dvenmic_prefer_remote=OFF"
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
cmake
|
||||||
|
cpm-cmake
|
||||||
|
git
|
||||||
|
# Pkg-config is implicitly used by CMake and will fail to find libs
|
||||||
|
# without it.
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
pulseaudio
|
||||||
|
pipewire
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
in venmic
|
||||||
Reference in New Issue
Block a user