Skip to content

Commit

Permalink
Add README.md, update-qt
Browse files Browse the repository at this point in the history
  • Loading branch information
thestr4ng3r committed Feb 27, 2019
1 parent 55c90be commit 57f07aa
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 216 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ ${PATCHELF_SRC_DIR}_target=PATCHELF_SRC
#QT_SRC_URL=https://download.qt.io/official_releases/qt/5.12/5.12.1/single/qt-everywhere-src-5.12.1.tar.xz

QT_BIN_FILE=cutter-deps-qt.tar.gz
QT_BIN_URL=https://github.com/thestr4ng3r/cutter-deps-qt/releases/download/v3/cutter-deps-qt.tar.gz
QT_BIN_MD5=a6707ea2ea857c490d1c3886c01267b0
QT_BIN_URL=https://github.com/radareorg/cutter-deps-qt/releases/download/v4/cutter-deps-qt.tar.gz
QT_BIN_MD5=b47f52d4cbf6106abfd8b294211eabca
QT_BIN_DIR=qt
QT_PREFIX=${ROOT_DIR}/${QT_BIN_DIR}
${QT_BIN_DIR}_target=QT_BIN
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# cutter-deps

This repository contains scripts to build the dependencies for [Cutter](https://github.com/radareorg/cutter/).
214 changes: 0 additions & 214 deletions build-linux.sh

This file was deleted.

32 changes: 32 additions & 0 deletions scripts/update-qt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

import sys
import os
import requests
import re
import subprocess

makefile_path = os.path.join(os.path.dirname(sys.argv[0]), "..", "Makefile")

print("Fetching latest release")
json = requests.get("https://api.github.com/repos/radareorg/cutter-deps-qt/releases/latest").json()

release_url = json["assets"][0]["browser_download_url"]

print(f"Getting MD5 for {release_url}")

curl = subprocess.Popen(["curl", "-L", release_url], stdout=subprocess.PIPE)
md5sum = subprocess.run(["md5sum"], stdin=curl.stdout, capture_output=True, encoding="utf-8").stdout
curl.wait()

md5sum = re.match("([a-zA-Z0-9]+) ", md5sum).group(1)

print(f"MD5: {md5sum}")

with open(makefile_path) as f:
makefile = f.read()

makefile = re.sub("^QT_BIN_URL=.*$", f"QT_BIN_URL={release_url}".replace("\\", r"\\"), makefile, flags=re.MULTILINE)
makefile = re.sub("^QT_BIN_MD5=.*$", f"QT_BIN_MD5={md5sum}".replace("\\", r"\\"), makefile, flags=re.MULTILINE)

with open(makefile_path, "w") as f:
f.write(makefile)

0 comments on commit 57f07aa

Please sign in to comment.