Skip to content

Commit

Permalink
wscript: improve building from source tarball
Browse files Browse the repository at this point in the history
  • Loading branch information
wrl committed Aug 24, 2015
1 parent ddba777 commit c46a0fa
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,17 @@ def configure(conf):
conf.env.append_unique("CFLAGS", ["-std=c99", "-Wall", "-Werror"])

conf.env.VERSION = VERSION
conf.env.GIT_COMMIT = subprocess.check_output(
["git", "rev-parse", "--verify", "--short", "HEAD"]
).decode().strip()

try:
import os

devnull = open(os.devnull, 'w')

conf.env.GIT_COMMIT = subprocess.check_output(
["git", "rev-parse", "--verify", "--short", "HEAD"],
stderr=devnull).decode().strip()
except subprocess.CalledProcessError:
conf.env.GIT_COMMIT = ''

conf.define("VERSION", VERSION)
conf.define("_GNU_SOURCE", 1)
Expand All @@ -248,7 +256,7 @@ def build(bld):
bld.recurse("src")

def dist(dst):
pats = [".git*", "**/.git*", ".travis.yml"]
pats = [".git*", "**/.git*", ".travis.yml", "**/__pycache__"]
with open(".gitignore") as gitignore:
for l in gitignore.readlines():
if l[0] == "#":
Expand Down

0 comments on commit c46a0fa

Please sign in to comment.