From owner-freebsd-ports@freebsd.org Mon Nov 21 20:13:23 2016 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8B42C4D55D for ; Mon, 21 Nov 2016 20:13:23 +0000 (UTC) (envelope-from vivek@khera.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id CD7AB78C for ; Mon, 21 Nov 2016 20:13:23 +0000 (UTC) (envelope-from vivek@khera.org) Received: by mailman.ysv.freebsd.org (Postfix) id CCBE3C4D55C; Mon, 21 Nov 2016 20:13:23 +0000 (UTC) Delivered-To: ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC5C2C4D55B for ; Mon, 21 Nov 2016 20:13:23 +0000 (UTC) (envelope-from vivek@khera.org) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71B5178B for ; Mon, 21 Nov 2016 20:13:23 +0000 (UTC) (envelope-from vivek@khera.org) Received: by mail-wm0-x231.google.com with SMTP id a197so1828808wmd.0 for ; Mon, 21 Nov 2016 12:13:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=khera.org; s=google11; h=mime-version:from:date:message-id:subject:to; bh=PbZ30gpLq/lcnFK3B0+/LsQ6LzUoAt1gCi/XrAGcPmg=; b=U9qv/o+LL0dsIIPsXY8OSVOnIuYJY082rjfrlHDsBY6GMkYZhNaqjfm9ByJXr3+1oN Dchu2HJWn9ibFz8fgoUM590kZR+Z8EJj79orPw/5wvM/eMLzm5O77q0jKeN8K4+fn2j5 EVUsA3mzrByHDtU6zSZ82t1EifCgXYmRYObI0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=PbZ30gpLq/lcnFK3B0+/LsQ6LzUoAt1gCi/XrAGcPmg=; b=Q0FrOiSB67mUkWyIc8yMGs0jtf/S2vaGnz1s3EGoSUjyHyEcUaYel6UUaAsTN82W/i 5S9e4KHVtT4bNXcANsd7Ad9MDC1c4kLne6lzik1IIfM9yHBWI7Cs0KmeWDj0KMN0Un8c B6uhcGAoDdSchnD159m1E8d4Lzt9g6zQqabMVe+cAOq1mplrsruGifweElVM8ycnvU7u 6OxAB23BVtQlJkYhtgds2V9PEruIYFTVICnbRfvjjf0ibU8t0f1vSYFbepPJBZHGyvlG EalGNAtyyFX3cZrTMVeYXnKGLlq8L5mUrVHnxg4PpBpxsoxMz0ZOi+Vv0bmUtZefQ2uI qmSg== X-Gm-Message-State: AKaTC03qE/gz/yhWagJttt4sznTv89zYTSUh+waN83UUS4dgd6zR4bsIFrzqdwnncuWOUDnvofJ/6s1lnjHbHw== X-Received: by 10.28.30.146 with SMTP id e140mr18210418wme.112.1479759201217; Mon, 21 Nov 2016 12:13:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.207.75 with HTTP; Mon, 21 Nov 2016 12:13:20 -0800 (PST) From: Vick Khera Date: Mon, 21 Nov 2016 15:13:20 -0500 Message-ID: Subject: how to pass "-ldflags" to a go language build. To: FreeBSD Ports List Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2016 20:13:24 -0000 I'm looking at the port for net-mgmt/telegraf to see if we can have it bake in the version number into the binary. Right now when you run "telegraf -version" it just says literally "version". Apparently the right way to set their version is to pass it to the command line like this: go build -ldflags "-X main.version=$DISTVERSION" ... How can I convince the Go ports infrastructure to pass this flag to the right place? I don't see any obvious way in the Uses/go.mk file. Similarly, the databases/influxdb port could use this treatment, so it shows what version it is when you connect to it. Thanks!