nur: init client 335 and dbc/maps/camera/vmaps/mmaps

main
Raito Bezarius 1 year ago
parent 64ec2ed17b
commit 276f807167

@ -8,13 +8,20 @@
{ pkgs ? import <nixpkgs> { } }:
let
callPackage = pkgs.lib.callPackageWith (pkgs // packages);
packages = rec {
wow_335a = callPackage ./pkgs/client/335.nix { };
assets_335a = callPackage ./pkgs/maps/335.nix {
inherit wow_335a;
};
# some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { };
# ...
};
in
{
# The `lib`, `modules`, and `overlay` names are special
lib = import ./lib { inherit pkgs; }; # functions
modules = import ./modules; # NixOS modules
overlays = import ./overlays; # nixpkgs overlays
example-package = pkgs.callPackage ./pkgs/example-package { };
# some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { };
# ...
}
} // packages

@ -2,16 +2,16 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1624561540,
"narHash": "sha256-izJ2PYZMGMsSkg+e7c9A1x3t/yOLT+qzUM6WQsc2tqo=",
"owner": "NixOS",
"lastModified": 1691432943,
"narHash": "sha256-ubHqjRKppVAf90rYZtvzU+Rvs4Os2DPc23zmyuUMRTA=",
"owner": "RaitoBezarius",
"repo": "nixpkgs",
"rev": "c6a049a3d32293b24c0f894a840872cf67fd7c11",
"rev": "2357a90036caa82f971c4e94e7fcd8e991918ced",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"owner": "RaitoBezarius",
"ref": "tc",
"repo": "nixpkgs",
"type": "github"
}

@ -1,6 +1,6 @@
{
description = "My personal NUR repository";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
description = "World of Warcraft related NUR";
inputs.nixpkgs.url = "github:RaitoBezarius/nixpkgs/tc";
outputs = { self, nixpkgs }:
let
systems = [
@ -8,8 +8,6 @@
"i686-linux"
"x86_64-darwin"
"aarch64-linux"
"armv6l-linux"
"armv7l-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
in

@ -0,0 +1,30 @@
{ stdenv, requireFile, lib }:
stdenv.mkDerivation {
pname = "world-of-warcraft-client-en_US";
version = "3.3.5a-12340";
preferLocalBuild = true;
src = requireFile {
name = "WoW_335a_en_US";
url = "https://download.wowdl.net/downloadFiles/Clients/World-of-Warcraft-3.3.5a.12340-enUS.zip";
hash = "sha256-yBPxE/IXRh5nph8VSSwn1GnmjoGaNdI7PTpZ6ngE2H0=";
hashMode = "recursive";
};
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
mkdir -p $out
cp -rv . $out/
'';
passthru = {
locale = "en-US";
};
meta = with lib; {
description = "World Of Warcraft client for 3.3.5a";
maintainers = with maintainers; [ raitobezarius ];
};
}

@ -0,0 +1,14 @@
{ wow_335a, trinitycore_335, callPackage, lib }:
let
extractors = callPackage ./generic.nix {
wowClient = wow_335a;
trinityCoreTools = trinitycore_335;
};
in
{
dbc = extractors "dbc";
maps = extractors "map";
camera = extractors "camera";
vmaps = extractors "vmaps";
mmaps = extractors "mmaps";
}

@ -0,0 +1,63 @@
{ wowClient, trinityCoreTools, stdenv, lib, symlinkJoin }:
let
extractor = assetVariant:
let
tool = {
"map" = "mapextractor";
"dbc" = "mapextractor";
"camera" = "mapextractor";
"vmaps" = "vmap4extractor";
"mmaps" = "mmaps_generator";
}.${assetVariant};
toolInvocation = {
"map" = "${tool} -i ${toString wowClient} -o $out -e 1";
"dbc" = "${tool} -i ${toString wowClient} -o $out -e 2";
"camera" = "${tool} -i ${toString wowClient} -o $out -e 4";
"vmaps" = "${tool}";
"mmaps" = "${tool}";
}.${assetVariant};
assembleInvocation = {
"vmaps" = "vmap4assembler Buildings $out/vmaps";
"mmaps" = "rm -rf $out/mmaps && mv mmaps $out/mmaps";
}.${assetVariant} or null;
targetDirectory = {
"map" = "maps";
"dbc" = "dbc";
"camera" = "Cameras";
"vmaps" = "vmaps";
"mmaps" = "mmaps";
}.${assetVariant};
in
stdenv.mkDerivation {
pname = "${assetVariant}-${wowClient.passthru.locale}";
version = wowClient.version;
src = if assetVariant == "mmaps"
then
symlinkJoin {
name = "${wowClient.name}-with-extracted-maps-and-vmaps-and-dbc";
paths = [
wowClient
(extractor "dbc")
(extractor "map")
(extractor "vmaps")
];
} else wowClient;
preferLocalBuild = assetVariant != "mmaps";
nativeBuildInputs = [
trinityCoreTools
];
buildPhase = ''
mkdir -p $out/${targetDirectory}
${toolInvocation}
'';
installPhase = lib.optionalString (assembleInvocation != null) ''
${assembleInvocation}
'';
};
in
extractor
Loading…
Cancel
Save