From eed5444d4a44f65764f0b4c1660706181b32900c Mon Sep 17 00:00:00 2001 From: Zachary Snow Date: Fri, 7 Feb 2020 18:57:48 -0500 Subject: [PATCH] updated version info with git hash --- LICENSE | 2 +- NOTICE | 33 +++++++++++++++++++++++++++++++++ src/Job.hs | 12 ++++++++++-- sv2v.cabal | 1 + 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index ca68713..f5aa37f 100644 --- a/LICENSE +++ b/LICENSE @@ -2,7 +2,7 @@ BSD 3-Clause License Copyright for portions of sv2v are held by Tom Hawkins, 2011-2015, as part of tomahawkins/verilog. Copyright for all other portions of sv2v are held by -Zachary Snow, 2019. +Zachary Snow, 2019-2020. All rights reserved. diff --git a/NOTICE b/NOTICE index f8d9483..5e87dfe 100644 --- a/NOTICE +++ b/NOTICE @@ -743,6 +743,39 @@ Dependency: ghc-prim-0.5.3 be a definition of the Haskell 98 Language. +================================================================================ +Dependency: githash-0.1.3.1 +================================================================================ + + Copyright (c) 2018, Michael Snoyman, 2015, Adam C. Foltzer + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of gitrev nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ================================================================================ Dependency: happy-1.19.9 ================================================================================ diff --git a/src/Job.hs b/src/Job.hs index 0633df5..ce95624 100644 --- a/src/Job.hs +++ b/src/Job.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE TemplateHaskell #-} {- sv2v - Author: Zachary Snow - @@ -7,6 +8,7 @@ module Job where +import GitHash (giHash, tGitInfoCwd) import System.IO (stderr, hPutStr) import System.Console.CmdArgs import System.Environment (getArgs, withArgs) @@ -27,6 +29,11 @@ data Job = Job , verbose :: Bool } deriving (Show, Typeable, Data) +gitHash :: String +gitHash = giHash $$tGitInfoCwd +shortGitHash :: String +shortGitHash = take 7 gitHash + defaultJob :: Job defaultJob = Job { files = def &= args &= typ "FILES" @@ -43,9 +50,10 @@ defaultJob = Job , verbose = nam "verbose" &= help "Retain certain conversion artifacts" } &= program "sv2v" - &= summary "sv2v v0.0.1, (C) 2019 Zachary Snow, 2011-2015 Tom Hawkins" + &= summary ("sv2v v0.0.1 (" ++ shortGitHash ++ ")") &= details [ "sv2v converts SystemVerilog to Verilog." - , "More info: https://github.com/zachjs/sv2v" ] + , "More info: https://github.com/zachjs/sv2v" + , "(C) 2019-2020 Zachary Snow, 2011-2015 Tom Hawkins" ] &= helpArg [explicit, name "help", groupname "Other"] &= versionArg [explicit, name "version"] &= verbosityArgs [ignore] [ignore] diff --git a/sv2v.cabal b/sv2v.cabal index e957fad..9eb9a0d 100644 --- a/sv2v.cabal +++ b/sv2v.cabal @@ -30,6 +30,7 @@ executable sv2v containers, directory, filepath, + githash, hashable, mtl, Unique