Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions qsc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@
def is_windows():
return platform.system() == "Windows"

def is_linux():
return platform.system() == "Linux"

# Paths
BASE_PATH = os.path.dirname(__file__)
DATA_PATH = os.path.join(BASE_PATH, "data")

WINBUILD_PATH = os.path.join(DATA_PATH, "winbuild.bat")
LINBUILD_PATH = os.path.join(DATA_PATH, "linbuild.sh")

# Settings
REPO_BASE_URL = "https://download.qt.io/"
REPO_SRC_PATH = "{0}/official_releases/qt/{1}/{2}/single/qt-everywhere-src-{2}.zip"
REPO_SRC_PATH = "{0}/official_releases/qt/{1}/{2}/single/qt-everywhere-opensource-src-{2}.tar.xz"
REPO_JOM_PATH = "{0}/official_releases/jom/jom.zip"

USE_CACHE = True
USE_JOM = True
USE_JOM = True
6 changes: 6 additions & 0 deletions qsc/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ def install_jom():
os.putenv("VS_EDITION", compiler["edition"])
os.putenv("VCVARSALL", compiler.get("vcvarsall", ""))
os.putenv("USE_VS", "1")
elif compiler["name"] == "gcc":
if not qsc.is_linux():
print("Only supported on Linux!")
exit(1)
else:
print("Unknown compiler '{}'".format(compiler.name))
exit(1)
Expand Down Expand Up @@ -172,6 +176,8 @@ def install_jom():

if qsc.is_windows():
os.system(qsc.WINBUILD_PATH)
elif qsc.is_linux():
os.system(qsc.LINBUILD_PATH)
else:
print("Not supported yet, sorry :/")
exit(1)
Expand Down
29 changes: 29 additions & 0 deletions qsc/data/linbuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this have execute permissions set?

# QSC (Qt SDK Creator) - A tool for automatically downloading, building and stripping down Qt
# Copyright (C) 2020 OatmealDome
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

set -e

../qt-everywhere-src-$RELEASE/configure \
-opensource -confirm-license \
-nomake examples -nomake tests \
$QT_CONFIGURE_OPTIONS \
-prefix $OUTNAME \
$QT_PLATFORM

make -j4

make install
2 changes: 1 addition & 1 deletion qsc/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def download_file(url, path):

def download_release(release):
url = source_url(release)
download_path = os.path.join("archives", "qt-everywhere-src-{}.zip".format(release))
download_path = os.path.join("archives", "qt-everywhere-opensource-src-{}.tar.xz".format(release))

print("Downloading Qt {}...".format(release), end="", flush=True)

Expand Down
10 changes: 5 additions & 5 deletions qsc/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@
"""Extracting archives and stuff"""

import os
import zipfile
import tarfile

import qsc

def extract_release(release):
name = "qt-everywhere-src-{}".format(release)
name = "qt-everywhere-opensource-src-{}".format(release)

zip_path = os.path.join("archives", name+".zip")
tar_path = os.path.join("archives", name+".tar.xz")

print("Extracting...", end="", flush=True)

if qsc.USE_CACHE and os.path.isdir(name):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When extracted the directory within the archive is still qt-everywhere-src not qt-everywhere-opensource-src.

Suggested change
if qsc.USE_CACHE and os.path.isdir(name):
if qsc.USE_CACHE and os.path.isdir("qt-everywhere-src-{}".format(release)):

print("Cached")
return

with zipfile.ZipFile(zip_path, "r") as zip:
zip.extractall(".")
with tarfile.open(tar_path) as tar:
tar.extractall(".")

print("Done")