Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix linenoise regression #13395

Merged
merged 2 commits into from
Feb 12, 2020
Merged
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
30 changes: 19 additions & 11 deletions tools/niminst/niminst.nim
Original file line number Diff line number Diff line change
@@ -505,12 +505,20 @@ proc writeInstallScripts(c: var ConfigData) =
writeFile(deinstallShFile, generateDeinstallScript(c), "\10")
inclFilePermissions(deinstallShFile, {fpUserExec, fpGroupExec, fpOthersExec})

template gatherFiles(fun, libpath, outDir) =
block:
timotheecour marked this conversation as resolved.
Show resolved Hide resolved
template copySrc(src) =
let dst = outDir / extractFilename(src)
when false: echo (dst, dst)
fun(src, dst)

for f in walkFiles(libpath / "lib/*.h"): copySrc(f)
copySrc(libpath / "lib/wrappers/linenoise/linenoise.h")

proc srcdist(c: var ConfigData) =
if not existsDir(getOutputDir(c) / "c_code"):
createDir(getOutputDir(c) / "c_code")
for x in walkFiles(c.libpath / "lib/*.h"):
when false: echo(getOutputDir(c) / "c_code" / extractFilename(x))
copyFile(dest=getOutputDir(c) / "c_code" / extractFilename(x), source=x)
let cCodeDir = getOutputDir(c) / "c_code"
if not existsDir(cCodeDir): createDir(cCodeDir)
gatherFiles(copyFile, c.libpath, cCodeDir)
var winIndex = -1
var intel32Index = -1
var intel64Index = -1
@@ -603,8 +611,9 @@ when haveZipLib:
addFile(z, proj / makeFile, "build" / makeFile)
addFile(z, proj / installShFile, installShFile)
addFile(z, proj / deinstallShFile, deinstallShFile)
for f in walkFiles(c.libpath / "lib/*.h"):
addFile(z, proj / "c_code" / extractFilename(f), f)

template addFileAux(src, dst) = addFile(z, dst, src)
gatherFiles(addFileAux, c.libpath, proj / "c_code")
for osA in 1..c.oses.len:
for cpuA in 1..c.cpus.len:
var dir = buildDir(osA, cpuA)
@@ -647,8 +656,8 @@ proc xzDist(c: var ConfigData; windowsZip=false) =
processFile(proj / makeFile, "build" / makeFile)
processFile(proj / installShFile, installShFile)
processFile(proj / deinstallShFile, deinstallShFile)
for f in walkFiles(c.libpath / "lib/*.h"):
processFile(proj / "c_code" / extractFilename(f), f)
template processFileAux(src, dst) = processFile(dst, src)
gatherFiles(processFileAux, c.libpath, proj / "c_code")
for osA in 1..c.oses.len:
for cpuA in 1..c.cpus.len:
var dir = buildDir(osA, cpuA)
@@ -722,8 +731,7 @@ proc debDist(c: var ConfigData) =
copyNimDist(makeFile, makeFile)
copyNimDist(installShFile, installShFile)
createDir(workingDir / upstreamSource / "build")
for f in walkFiles(c.libpath / "lib/*.h"):
copyNimDist(f, "build" / extractFilename(f))
gatherFiles(copyNimDist, c.libpath, "build")
for osA in 1..c.oses.len:
for cpuA in 1..c.cpus.len:
var dir = buildDir(osA, cpuA)