-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
1 parent
55c90be
commit 57f07aa
Showing
4 changed files
with
38 additions
and
216 deletions.
There are no files selected for viewing
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,4 @@ | ||
|
||
# cutter-deps | ||
|
||
This repository contains scripts to build the dependencies for [Cutter](https://github.com/radareorg/cutter/). |
This file was deleted.
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
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) |