libreoffice: md5 -> sha256
This commit is contained in:
parent
1cb54e39f0
commit
356bae0aa9
@ -28,25 +28,17 @@ let
|
|||||||
lib = stdenv.lib;
|
lib = stdenv.lib;
|
||||||
langsSpaces = lib.concatStringsSep " " langs;
|
langsSpaces = lib.concatStringsSep " " langs;
|
||||||
|
|
||||||
fetchThirdParty = {name, md5, brief, subDir ? ""}: fetchurl {
|
|
||||||
inherit name md5;
|
|
||||||
url = if brief then
|
|
||||||
"http://dev-www.libreoffice.org/src/${subDir}${name}"
|
|
||||||
else
|
|
||||||
"http://dev-www.libreoffice.org/src/${subDir}${md5}-${name}";
|
|
||||||
};
|
|
||||||
|
|
||||||
fetchSrc = {name, sha256}: fetchurl {
|
fetchSrc = {name, sha256}: fetchurl {
|
||||||
url = "http://download.documentfoundation.org/libreoffice/src/${subdir}/libreoffice-${name}-${version}.tar.xz";
|
url = "http://download.documentfoundation.org/libreoffice/src/${subdir}/libreoffice-${name}-${version}.tar.xz";
|
||||||
inherit sha256;
|
inherit sha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
srcs = {
|
srcs = {
|
||||||
third_party = [ (fetchurl rec {
|
third_party = [ (let md5 = "185d60944ea767075d27247c3162b3bc"; in fetchurl rec {
|
||||||
url = "http://dev-www.libreoffice.org/extern/${md5}-${name}";
|
url = "http://dev-www.libreoffice.org/extern/${md5}-${name}";
|
||||||
md5 = "185d60944ea767075d27247c3162b3bc";
|
sha256 = "1infwvv1p6i21scywrldsxs22f62x85mns4iq8h6vr6vlx3fdzga";
|
||||||
name = "unowinreg.dll";
|
name = "unowinreg.dll";
|
||||||
}) ] ++ (map fetchThirdParty (import ./libreoffice-srcs.nix));
|
}) ] ++ (map fetchurl (import ./libreoffice-srcs.nix));
|
||||||
|
|
||||||
translations = fetchSrc {
|
translations = fetchSrc {
|
||||||
name = "translations";
|
name = "translations";
|
||||||
|
@ -8,28 +8,64 @@ of the input file, and writes the result to stdout.
|
|||||||
|
|
||||||
todo - Ideally we would move as much as possible into derivation dependencies.
|
todo - Ideally we would move as much as possible into derivation dependencies.
|
||||||
"""
|
"""
|
||||||
import collections, itertools, json, re, sys, os
|
import collections, itertools, json, re, subprocess, sys, os
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
|
packages = list(get_packages())
|
||||||
|
|
||||||
|
for x in packages:
|
||||||
|
print(x, file=sys.stderr)
|
||||||
|
|
||||||
print('[')
|
print('[')
|
||||||
|
|
||||||
for x in get_packages():
|
for x in packages:
|
||||||
|
|
||||||
print('{')
|
md5 = x['md5']
|
||||||
|
tarball = x['tarball']
|
||||||
|
|
||||||
print(' name = "{}";'.format(x['tarball']))
|
url = construct_url(x)
|
||||||
print(' md5 = "{}";'.format(x['md5']))
|
print('url: {}'.format(url), file=sys.stderr)
|
||||||
print(' brief = {};'.format('true' if x['brief'] else 'false'))
|
|
||||||
|
|
||||||
if 'subdir' in x:
|
path = download(url, tarball, md5)
|
||||||
print(' subDir = "{}";'.format(x['subdir']))
|
print('path: {}'.format(path), file=sys.stderr)
|
||||||
|
|
||||||
print('}')
|
sha256 = get_sha256(path)
|
||||||
|
print('sha256: {}'.format(sha256), file=sys.stderr)
|
||||||
|
|
||||||
|
print(' {')
|
||||||
|
print(' name = "{}";'.format(tarball))
|
||||||
|
print(' url = "{}";'.format(url))
|
||||||
|
print(' sha256 = "{}";'.format(sha256))
|
||||||
|
print(' }')
|
||||||
|
|
||||||
print(']')
|
print(']')
|
||||||
|
|
||||||
|
|
||||||
|
def construct_url(x):
|
||||||
|
if x['brief']:
|
||||||
|
return 'http://dev-www.libreoffice.org/src/{}{}'.format(
|
||||||
|
x.get('subdir', ''), x['tarball'])
|
||||||
|
else:
|
||||||
|
return 'http://dev-www.libreoffice.org/src/{}{}-{}'.format(
|
||||||
|
x.get('subdir', ''), x['md5'], x['tarball'])
|
||||||
|
|
||||||
|
|
||||||
|
def download(url, name, md5):
|
||||||
|
cmd = ['nix-prefetch-url', url, md5, '--print-path',
|
||||||
|
'--type', 'md5', '--name', name]
|
||||||
|
proc = subprocess.run(cmd, stdout=subprocess.PIPE, check=True,
|
||||||
|
universal_newlines=True)
|
||||||
|
return proc.stdout.split('\n')[1].strip()
|
||||||
|
|
||||||
|
|
||||||
|
def get_sha256(path):
|
||||||
|
cmd = ['sha256sum', path]
|
||||||
|
proc = subprocess.run(cmd, stdout=subprocess.PIPE, check=True,
|
||||||
|
universal_newlines=True)
|
||||||
|
return proc.stdout.split(' ')[0].strip()
|
||||||
|
|
||||||
|
|
||||||
def get_packages():
|
def get_packages():
|
||||||
"""
|
"""
|
||||||
All of the package data: What's parsed from download.lst,
|
All of the package data: What's parsed from download.lst,
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -28,25 +28,17 @@ let
|
|||||||
lib = stdenv.lib;
|
lib = stdenv.lib;
|
||||||
langsSpaces = lib.concatStringsSep " " langs;
|
langsSpaces = lib.concatStringsSep " " langs;
|
||||||
|
|
||||||
fetchThirdParty = {name, md5, brief, subDir ? ""}: fetchurl {
|
|
||||||
inherit name md5;
|
|
||||||
url = if brief then
|
|
||||||
"http://dev-www.libreoffice.org/src/${subDir}${name}"
|
|
||||||
else
|
|
||||||
"http://dev-www.libreoffice.org/src/${subDir}${md5}-${name}";
|
|
||||||
};
|
|
||||||
|
|
||||||
fetchSrc = {name, sha256}: fetchurl {
|
fetchSrc = {name, sha256}: fetchurl {
|
||||||
url = "http://download.documentfoundation.org/libreoffice/src/${subdir}/libreoffice-${name}-${version}.tar.xz";
|
url = "http://download.documentfoundation.org/libreoffice/src/${subdir}/libreoffice-${name}-${version}.tar.xz";
|
||||||
inherit sha256;
|
inherit sha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
srcs = {
|
srcs = {
|
||||||
third_party = [ (fetchurl rec {
|
third_party = [ (let md5 = "185d60944ea767075d27247c3162b3bc"; in fetchurl rec {
|
||||||
url = "http://dev-www.libreoffice.org/extern/${md5}-${name}";
|
url = "http://dev-www.libreoffice.org/extern/${md5}-${name}";
|
||||||
md5 = "185d60944ea767075d27247c3162b3bc";
|
sha256 = "1infwvv1p6i21scywrldsxs22f62x85mns4iq8h6vr6vlx3fdzga";
|
||||||
name = "unowinreg.dll";
|
name = "unowinreg.dll";
|
||||||
}) ] ++ (map fetchThirdParty (import ./libreoffice-srcs-still.nix));
|
}) ] ++ (map fetchurl (import ./libreoffice-srcs-still.nix));
|
||||||
|
|
||||||
translations = fetchSrc {
|
translations = fetchSrc {
|
||||||
name = "translations";
|
name = "translations";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user