mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
Made with
```shell
git restore .
fd '\.nix$' pkgs/ --type f -j1 -x bash -xc "$(cat <<"EOF"
typos --no-check-filenames --write-changes "$1"
git diff --exit-code "$1" && exit
#( git diff "$1" | grep -qE "^\+ +[^# ]") && git restore "$1"
count1="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> ' | wc -l )"
count2="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> (<span style="color:#f8f8f2;"> *</span>)?<span style="color:#75715e;">.*</span>$' | wc -l )"
[[ $count1 -ne $count2 ]] && git restore "$1"
EOF
)" -- {}
```
and filtered with `GIT_DIFF_OPTS='--unified=15' git -c interactive.singleKey=true add --patch`
I initially tried using the tree-sitter cli, python bindings and even ast-grep through various means, but this is what I ended up with.
87 lines
2.6 KiB
Nix
87 lines
2.6 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
replaceVars,
|
|
callPackage,
|
|
}:
|
|
|
|
# Note for maintainers:
|
|
#
|
|
# These packages are only allowed to be packaged under the the condition that we
|
|
# - patch source/creator/config.d to not point to upstream's bug tracker
|
|
# - use the "barebones" configuration to remove the mascot and logo from the build
|
|
#
|
|
# We have received permission by the owner to go ahead with the packaging, as we have met all the criteria
|
|
# https://github.com/NixOS/nixpkgs/pull/288841#issuecomment-1950247467
|
|
|
|
let
|
|
mkGeneric = builderArgs: callPackage ./generic.nix { inherit builderArgs; };
|
|
in
|
|
{
|
|
inochi-creator = mkGeneric rec {
|
|
pname = "inochi-creator";
|
|
appname = "Inochi Creator";
|
|
version = "0.8.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Inochi2D";
|
|
repo = "inochi-creator";
|
|
rev = "v${version}";
|
|
hash = "sha256-9d3j5ZL6rGOjN1GUpCIfbjby0mNMvOK7BJbHYgwLY2k=";
|
|
};
|
|
|
|
dubLock = ./creator-dub-lock.json;
|
|
|
|
patches = [
|
|
# Upstream asks that we change the bug tracker URL to not point to the upstream bug tracker
|
|
(replaceVars ./support-url.patch {
|
|
assignees = "TomaSajt"; # should be a comma separated list of the github usernames of the maintainers
|
|
})
|
|
# Change how duplicate locales differentiate themselves (the store paths were too long)
|
|
./translations.patch
|
|
];
|
|
|
|
meta = {
|
|
# darwin has slightly different build steps
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
changelog = "https://github.com/Inochi2D/inochi-creator/releases/tag/${src.rev}";
|
|
description = "An open source editor for the Inochi2D puppet format";
|
|
};
|
|
};
|
|
|
|
inochi-session = mkGeneric rec {
|
|
pname = "inochi-session";
|
|
appname = "Inochi Session";
|
|
version = "0.8.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Inochi2D";
|
|
repo = "inochi-session";
|
|
rev = "v${version}";
|
|
hash = "sha256-FcgzTCpD+L50MsPP90kfL6h6DEUtiYkUV1xKww1pQfg=";
|
|
};
|
|
|
|
patches = [
|
|
# Dynamically load Lua to get around the linker error on aarch64-linux.
|
|
# https://github.com/Inochi2D/inochi-session/pull/60
|
|
./session-dynamic-lua.patch
|
|
];
|
|
|
|
dubLock = ./session-dub-lock.json;
|
|
|
|
preFixup = ''
|
|
patchelf $out/share/inochi-session/inochi-session --add-needed cimgui.so
|
|
'';
|
|
|
|
dontStrip = true; # symbol lookup error: undefined symbol: , version
|
|
|
|
meta = {
|
|
# darwin has slightly different build steps
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
changelog = "https://github.com/Inochi2D/inochi-session/releases/tag/${src.rev}";
|
|
description = "An application that allows streaming with Inochi2D puppets";
|
|
};
|
|
};
|
|
}
|