-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
487 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ poetry2nix, ... }: self: super: { poetry2nix = poetry2nix.lib.mkPoetry2Nix { pkgs = self; }; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
lib, | ||
stdenvNoCC, | ||
runCommand, | ||
poetry2nix, | ||
libarchive, | ||
}: | ||
|
||
let | ||
dl = poetry2nix.mkPoetryApplication { | ||
projectDir = ./.; | ||
overrides = poetry2nix.defaultPoetryOverrides.extend ( | ||
final: prev: { | ||
pycdlib = prev.pycdlib.overridePythonAttrs (old: { | ||
buildInputs = (old.buildInputs or [ ]) ++ [ prev.setuptools ]; | ||
}); | ||
httpio = prev.httpio.overridePythonAttrs (old: { | ||
buildInputs = (old.buildInputs or [ ]) ++ [ prev.setuptools ]; | ||
}); | ||
libarchive-c = prev.libarchive-c.overridePythonAttrs (old: { | ||
postPatch = | ||
(old.postPatch or "") | ||
+ '' | ||
echo "Patching find_library call." | ||
substituteInPlace libarchive/ffi.py \ | ||
--replace-warn "find_library('archive')" "\"${libarchive.lib}/lib/libarchive.so\"" | ||
''; | ||
}); | ||
} | ||
); | ||
}; | ||
in | ||
stdenvNoCC.mkDerivation rec { | ||
pname = "office-fonts"; | ||
version = "2007"; | ||
|
||
src = | ||
runCommand "office-fonts-src" | ||
{ | ||
outputHashMode = "recursive"; | ||
outputHash = "sha256-unbiYm7lBGt4xy0/ul3VFOylAUbQV8GF44MVJWDbt5I="; | ||
nativeBuildInputs = [ dl ]; | ||
} | ||
'' | ||
mkdir $out | ||
cd $out | ||
dl | ||
''; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
install -Dm644 *.TTF -t $out/share/fonts/truetype | ||
runHook postInstall | ||
''; | ||
|
||
meta = with lib; { | ||
maintainers = with maintainers; [ leo60228 ]; | ||
platforms = platforms.all; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import libarchive | ||
import requests | ||
import pycdlib | ||
import sys | ||
|
||
old_version = sys.version_info | ||
sys.version_info = (3, 5) | ||
import httpio | ||
sys.version_info = old_version | ||
|
||
def dl(): | ||
print('querying redirect') | ||
url = "https://archive.org/download/microsoft-office-professional-plus-2007/Microsoft%20Office%20Professional%20Plus%202007.iso" | ||
target = requests.head(url).headers['Location'] | ||
|
||
print('making request') | ||
iso_fp = httpio.open(target, block_size=4*1024*1024) | ||
|
||
print('opening iso') | ||
iso = pycdlib.PyCdlib() | ||
iso.open_fp(iso_fp) | ||
|
||
print('opening file') | ||
with iso.open_file_from_iso(iso_path='/PROPLUSW/PROPLSWW.CAB') as cab_fp: | ||
print('reading archive') | ||
with libarchive.stream_reader(cab_fp) as archive: | ||
print('archive loaded') | ||
for entry in archive: | ||
if entry.name.endswith('.TTF'): | ||
print(entry.name) | ||
with open(entry.name, 'wb') as out: | ||
for block in entry.get_blocks(): | ||
out.write(block) | ||
if entry.name == "WINGDNG3.TTF": | ||
break |
Oops, something went wrong.